data-migration-tool
data-migration-tool copied to clipboard
Integrity constraint violation: 1062 Duplicate entry 'XXX-XXX' for key 'EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_ATTRIBUTE_ID'
Preconditions
- Migrating from Magento 1.9.3.10
- Migrating to Magento 2.3.5-p1
Steps to reproduce
- Run Settings migration as usual
- Run Data migration as usual
Expected result
- Migration with no errors or integrity step failing with details
Actual result
- Integrity constraint violation: 1062 Duplicate entry 'XX-XXX' for key 'EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_ATTRIBUTE_ID'
Additional notes
I have 44 attribute sets in my M1 database. This error only comes up with 2 of the (Attribute set IDs 9 and 12).
I've already checked my M1 & M2 databases and there are no duplicated entries as the error says. Also, this was recognized as a bug on a previous version of Data Migration Tool.
The suggested solution was comment/remove remove a method at Migration/Step/Eav/Data.php and add the attributes manually to the sets.
Is there a official or tested fix for this?
Note: Here is a list with some of the attribute_set_id / attribute_id combination which fails.
Integrity constraint violation: 1062 Duplicate entry '9-110' for key 'EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_ATTRIBUTE_ID'
Integrity constraint violation: 1062 Duplicate entry '9-503' for key 'EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_ATTRIBUTE_ID'
Integrity constraint violation: 1062 Duplicate entry '9-863' for key 'EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_ATTRIBUTE_ID'
Integrity constraint violation: 1062 Duplicate entry '12-111' for key 'EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_ATTRIBUTE_ID'
(The same happen to almost all attributes assigned to attribute sets 9 and 12).
Hi @alejandrosantafixie. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Hi @alejandrosantafixie! :wave:
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.
@victor-v-rad This is the same problem, and it's coming up again because data-migration-tool/src/Migration/Step/Eav/Data.php was completly rewritten in Data Migration Tool 2.3.5: https://github.com/magento/data-migration-tool/issues/201#issuecomment-361440309.
It looks like the issue is at the createProductAttributeSetStructures method
I ran a migration using the same M1 database, but downgrading my M2 to v.2.3.4 and it worked.
Comparing the 2.3.4 and 2.3.5 results, I found that data-migration-tool/src/Migration/Step/Eav/Data.php file was completely rewritten and the renaming step from "Default" to "Migration_Default" for the Attribute Set contained in eav_attribute_set table were removed on the latest version of Data Migration Tool.
In this scenario, there is a very high probability to get constrains like this: Duplicate entry 'xxx-xxx' for key 'EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_ATTRIBUTE_ID'.
Hi @alejandrosantafixie
I comitted a fix https://github.com/magento/data-migration-tool/commit/46c1d11d598daba30681f700c63718740c77ba15 for EAV step into 2.3-develop branch Please try it and see if it helps
@victor-v-rad I tested the patch in Magento 2.3.5. Doesn't fix the issue :/
Also having this issue.
Met too same here SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9-Images' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME'
@scheMeZa @takeoffdigital Try with Magento & Data Migration Tool 2.3.4. Then, update your Magento version to 2.3.5.
FYI, I was getting this exact error for a commerce-to-commerce migration from 1.14.4.5 to 2.3.5. It was getting hung up on attribute_code rma_entity_id, despite being a completely fresh install and only having a single row for that attribute in M1.
After restoring from backup to a new fresh install and running with the latest nightly code I no longer get this error.