2

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'

2 Answers 2

2
+100

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.

11
  • i have allready try this but still not working Commented Feb 26, 2019 at 12:57
  • obviously i have rename this file Commented Feb 26, 2019 at 12:58
  • yes right.......... Commented Feb 26, 2019 at 13:01
  • let me check and update you Commented Feb 26, 2019 at 13:14
  • 1
    Can you, who downvoted, please explain your reasoning Commented Feb 27, 2019 at 8:19
0

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

6
  • edit my answer, just look Commented Feb 20, 2019 at 8:43
  • if i think add your code then migration not successfully not done Commented Feb 20, 2019 at 8:45
  • you have mysql error , that says : you have duplicated value principal in STORE_GROUP table in field - CODE, just ignore it, or edit. Commented Feb 20, 2019 at 8:47
  • where but i have just setup and run settings command Commented Feb 20, 2019 at 8:48
  • thats why you can ignore tables/fields that i have described above. Commented Feb 20, 2019 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.