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

Magento 1.9.3.2 to 2.3.5 migration #836

Open sahilrtpl opened 3 years ago

sahilrtpl commented 3 years ago

Preconditions

  1. Magento 1 version-1.9.3.2
  2. Magento 2 version-2.3.5

Steps to reproduce

  1. Install data migration tool-2.3.5
  2. Migrate settings
  3. Migrate Data

Expected result

1.Data Migration completed successfully

Actual result

  1. [PDOException (23000)]
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9-Images' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_G
    ROUP_NAME'
m2-assistant[bot] commented 3 years ago

Hi @sahilrtpl. 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


victor-v-rad commented 3 years ago

Hi @sahilrtpl Please try 2.3-develop branch of DMT. The issue you have could be fixed there

jesse-thomas commented 3 years ago

I'm having the same issue, the only difference is that I'm importing from Magento 1.9.4.1. I tried using 2.3-develop and still get the same error. I was migrating fine when on 2.3.3.

jesse-thomas commented 3 years ago

I was able to finish running the data migration tool after removing the conflicting records in the M2 database. The table was eav_attribute_group. Run the migration then remove all rows that match the attribute_set_id, you might have to run the migration a few times and re-delete some records to get all the attribute set ids.

EDIT: After a little looking around I found that this causes issues down the road. Some custom product attribute sets and data where not migrated.

jesse-thomas commented 3 years ago

I had two things working against me. I had setup code in M2 to add all my custom attributes and attribute sets/groups, that needed to be commented out. Also adding the changes from 2.3-develop allowed a good migration.

PascalBrouwers commented 3 years ago

Having the same issues. Duplicate entry '110-prijskaart-winkel' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE. But the old magento1 database only has 1 entry for this. So why the duplicate entry error?

PascalBrouwers commented 3 years ago

Ok, this is happening but I don't know why. 2 inserts:

INSERT INTO `eav_attribute_group` (`attribute_group_id`, `attribute_set_id`, `attribute_group_name`, `sort_order`, `default_id`, `attribute_group_code`, `tab_group_code`) VALUES (?, ?, ?, ?, ?, ?, ?)
(
    [attribute_group_id] =>
    [attribute_set_id] => 110
    [attribute_group_name] => Prijskaart winkel
    [sort_order] => 109
    [default_id] => 0
    [attribute_group_code] => prijskaart-winkel
    [tab_group_code] => basic
)

INSERT INTO `eav_attribute_group` (`attribute_group_id`, `attribute_set_id`, `attribute_group_name`, `sort_order`, `default_id`, `attribute_group_code`, `tab_group_code`) VALUES (?, ?, ?, ?, ?, ?, ?)
(
    [attribute_group_id] =>
    [attribute_set_id] => 110
    [attribute_group_name] => Prijskaart Winkel
    [sort_order] => 109
    [default_id] => 0
    [attribute_group_code] => prijskaart-winkel
    [tab_group_code] => basic
)
``

Notice the difference with `Prijskaart Winkel` and `Prijskaart winkel`. Why is this attribute group being inserted twice?
PascalBrouwers commented 3 years ago

So, 1 is coming from createProductAttributeSetStructures The other from migrateAttributeGroups

PascalBrouwers commented 3 years ago

I was running migration multiple times but I forgot to remove the extra attribute groups from the default attribute set before restarting the migration again.

rjm87 commented 3 years ago

Hi @PascalBrouwers, how did you fix this? I'm having the same issue (migrating from 1.9.4.5 > 2.4.1), but removing the extra attribute groups didn't work for me.