When I run migration command

sudo php bin/magento migrate:settings --reset

vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.4.0/config.xml

after below error showing..

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'principal' for key 'STORE_GROUP_CODE'

有帮助吗?

解决方案

Please perform following steps and run migrate:settings command after that, and do let me know if you get any issue.

Go to to this Directory "{your_root_directory}/vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.4.0/"
Rename file config.xml.dist to config.xml (remove .dist from end)
Rename file map.xml.dist to map.xml (remove .dist from end)

-- UPDATE --

Magento 2 has new field 'code' in store_group table and it is automatically created from magento 1 store name.

So it seems you have a duplicate store name in magento 1

Please do change your store name "principal" to anything from your magento 1 database

Please let me know if you get any issue after that.

其他提示

Add this entry to ignore file in migration config principal. and run again, it will work.

All these table names and fields which are not "standard" need to be either ignored or mapped in your version of the map.xml.dist configuration files.

add this line:

 <source>
      <field_rules>
        <ignore>
          <field>store_group.code</field>
        </ignore>

      <ignore>
           <field>store_group.group_id</field>
       </ignore>
<ignore>
           <field>store_group.website_id</field>
       </ignore>
<ignore>
           <field>store_group.name_id</field>
       </ignore>
<ignore>
           <field>store_group.root_category_id</field>
       </ignore>
<ignore>
           <field>store_group.default_store_id</field>
       </ignore>

Or you can add tables to ignore like this:

<ignore>
  <document>core_config_data</document>
</ignore>
<ignore>
  <document>store_group</document>
</ignore>
<ignore>
  <document>store</document>
</ignore>
 <ignore>
  <document>store_website</document>
</ignore>

for more info go to Magento 2 documentation.

https://devdocs.magento.com/guides/v2.3/migration/migration-tool-configure.html

许可以下: CC-BY-SA归因
scroll top