Noting down the errors and possible solutions I get while migrating data from Magento 1 to Magento 2. In the data integrity step we can find many type of errors. Here you have some of them, explanation and solution:

ErrorForeign key (FK_CATALOG_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID) constraint fails on source database. Orphan records id: 121,182 from catalog_eav_attribute.attribute_id has no referenced records in `eav_attribute
ExplanationA catalog eav attribute (product attribute or category attribute) was created in the past and then was deleted incorrectly in the database.
SolutionIt’s only necessary to delete all the related records of that attribute:
delete from catalog_eav_attribute where attribute_id = ‘121’;
delete from catalog_eav_attribute where attribute_id = ‘182’;

It might be necessary to delete as well other records in tables with the attribute type (int, varchar…). To know that, run again the migration tool after deleting those attributes and you get a new error like I got:
Foreign key (FK_CAT_PRD_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID) constraint fails on source database. Orphan records id: 121 from catalog_product_entity_int.attribute_id has no referenced records in eav_attribute

Now you know where to delete all the attribute records:
delete from catalog_product_entity_int where attribute_id = ‘121’;

ErrorForeign key (FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID) constraint fails on source database. Orphan records id: 121,182 from eav_entity_attribute.attribute_id has no referenced records in eav_attribute
ExplanationThis error is similar to the previous one: missing records or references to the attributes with ID 121 or 182.
SolutionWe only need to delete those references:
delete from eav_entity_attribute where attribute_id = ‘121’;
delete from eav_entity_attribute where attribute_id = ‘182’;

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.