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:
Error | Foreign 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 |
Explanation | A catalog eav attribute (product attribute or category attribute) was created in the past and then was deleted incorrectly in the database. |
Solution | It’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’; |
Error | Foreign 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 |
Explanation | This error is similar to the previous one: missing records or references to the attributes with ID 121 or 182. |
Solution | We 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