magento / data-migration-tool

Magento Data Migration Tool
https://devdocs.magento.com/guides/v2.3/migration/bk-migration-guide.html
Open Software License 3.0
334 stars 200 forks source link

add update on duplicate for attribute groups #876

Closed Morgy93 closed 2 years ago

Morgy93 commented 3 years ago

Fixes #869

Code provided by @jriboux-advisa https://github.com/magento/data-migration-tool/issues/869#issuecomment-801516008

Description

Fixed Issues (if relevant)

  1. magento/data-migration-tool#869: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '11-general' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE'

Manual testing scenarios

  1. Have custom order attribute in M1
  2. Run migration

Contribution checklist

victor-v-rad commented 2 years ago

Thank you @Morgy93 for your contribution. Magento 1 has unique key UNQ_EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME by default. It prevents duplication of records. The fix in this pull request hides the issue of duplicated records. In case when the unique key was removed allowing two attribute groups having the same name but include two different attributes, after migration only one attribute will be included into one group. Duplication of attribute groups should be addressed in Magento 1 DB before migration

ghost commented 2 years ago

Hi @Morgy93, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

norgeindian commented 2 months ago

@victor-v-rad , please be so kind and check that issue again. In my eyes, it is pretty well explained in https://github.com/magento/data-migration-tool/issues/869#issuecomment-801516008. You're completely right in general, but if there was a custom order attribute in Magento 1, this attribute group will be created on the fly and as soon as we then want to migrate the groups properly, it will fail.