Error : SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-Migration_Default' for key 'EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_ATTRIBUTE_SET_NAME'

I reinstall the setup with a fresh database and it did not solve the issue. Please suggest a solution for this.

After reinstalling magento2 setup: a new error occured : Notice: Undefined offset: 8 in /opt/lampp/htdocs/namuk/NAMU/branches/namuk2.2.5/vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php

  • Migrate in which Magento? Commented Jun 28, 2018 at 11:13
  • from to 2.2.5 Commented Jun 28, 2018 at 12:41
  • Can you check 1-Migration_Default this value exists in eav_attribute_set table? Commented Jun 28, 2018 at 12:45
  • I have also faced the same issue, but not found any value like '1-Migration_Default' in entire db. Commented Dec 18, 2019 at 9:28

5 Answers 5


I think I know what happens, it's one I have banged my head against in the past

It happens that if an error stops the migration then the migration of the attribute sets does not get reverted, and several tables get left in a state that will break the next migration attempt. So the next time you will get undefined offset, then duplicate entry, then undefined offset, then duplicate entry

  • m2's eav_attribute_set table ends up containing the "migration_" entries after the undefined offset error or any other error during a further substep of the eav process (hence causing the "duplicate" error next time)

  • m2's eav_attribute_set table ends up completely empty after this error (causing the "undefined offset" error next time as the default entries are missing)

  • on and on forever

Note that you first have to have another error, like missing document. Ideally you keep a snapshot of the eav_attribute... tables and reset them.

For those struggling, I have managed to pass through by MANUALLY (in SQL) rebuilding the eav_attribute_set and eav_attribute_group tables in the database to have only the original entries, but with the IDs from after my first migration

But if I then get another error in the EAV step (eg: class name reference from a module I am not planning to migrate) then this error is back on the next run so I have to do that manual clean up over and over.

See my second comment on this issue on the migration tool bug tracker for details of the SQL https://github.com/magento/data-migration-tool/issues/204 to


Login to my SQL and go to Magento 2 database where you import data from magento 1 and search for migration_backup_eav_attribute_set NOTE if you added table prefix you have to add it after migration_backup_prefix_eav_attribute_set or searchEAV_ATTRIBUTE and you will find 2 tables starting with migration_backup Select that table and remove default_migration entries it should look after delete like this

enter image description here

now again run the command it should not give you the same error !


You should try to delete all data in two tables on Magento 2: eav_attribute_group and eav_attribute_set and re-install again


Try to use the latest version of the tool It has fixes which may help.

  • Iam using latest version of the tool 2.2.5 Commented Jun 28, 2018 at 12:40

Go to table eav_attribute_group and see if there are multiple entries for 1-Migration_Defaul in attribute_group_code column of the table. Delete any one row or try running migration command without -r|--reset arguments like this - php bin/magento bin/magento migrate:data {<path to config.xml>}

  • there is no multiple entries Commented Jun 28, 2018 at 12:41
  • In which database are you checking? Check in destination database.
    – mighty_hk
    Commented Jun 28, 2018 at 12:43
  • Yes in the destination database @mighty_hk Commented Jun 28, 2018 at 13:05
  • Then try running command without -r argument like this - php bin/magento bin/magento migrate:data {<path to config.xml>}
    – mighty_hk
    Commented Jun 29, 2018 at 4:46

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.