1

When I run migrate:data I get some errors, any way to fix this?

[2017-03-06 17:00:38][ERROR]: Foreign key (FK_CATALOG_COMPARE_ITEM_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID) constraint fails. Orphan records id: 0 from `catalog_compare_item`.`customer_id` has no referenced records in `customer_entity`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_CATALOG_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID) constraint fails. Orphan records id: 903 from `catalog_eav_attribute`.`attribute_id` has no referenced records in `eav_attribute`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_CAT_PRD_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID) constraint fails. Orphan records id: 903 from `catalog_product_entity_int`.`attribute_id` has no referenced records in `eav_attribute`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID) constraint fails. Orphan records id: 19,21 from `eav_attribute`.`entity_type_id` has no referenced records in `eav_entity_type`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_EAV_ATTR_SET_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID) constraint fails. Orphan records id: 19,21 from `eav_attribute_set`.`entity_type_id` has no referenced records in `eav_entity_type`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID) constraint fails. Orphan records id: 202,213,706,732,903,2712 from `eav_entity_attribute`.`attribute_id` has no referenced records in `eav_attribute`

and this is another one

[2017-03-06 17:00:42][ERROR]: Source documents are not mapped: paybox_question_number,strikeiron_tax_rate

2 Answers 2

3

First problem: Foreign key (fk_...) constraint fails. Orphan records id: ...

What does it mean?

  • You have orphan records in your database. This means that a foreign key is referencing another item which doens't exist anymore. Check some SQL-Tutorials or documentation to read more about it.

How to solve it:

Second problem: Source documents are not mapped

What does it mean?

  • (I'm not complete sure about this, probably correction needed): You have had different tables that are no more the same, but in a way that the migration tool can't recognize it, as they are customized or extended tables. So in that case you have to check manually whether you want or need to migrate that data aswell or exclude it.

How to solve it:

4
  • for orphan records can I just delete that products content field? do you know if it is a attribute or what?
    – brody
    Commented Mar 6, 2017 at 20:19
  • It would probably solve that problem. Take care and backup first. 1: No referenced customer_entity with that id, so no referenced customer 2/3/6: No referenced attribute 4/5: No referenced entity type Other solution would be to check whats missing and reproduce that through SQL commands
    – NFS
    Commented Mar 6, 2017 at 20:27
  • if I add ignore in map.xml I still get the error because "paybox_question_number,strikeiron_tax_rate" only exists in magento 1.6.2.0 and I upgraded to 1.9.2.2 some time ago
    – brody
    Commented Mar 7, 2017 at 6:21
  • There are different of these files which are used. Check which one is needed, maybe it's another... But I'm not sure whether this solves your problem or not.
    – NFS
    Commented Mar 8, 2017 at 18:46
0

According to the issues section of the data migration tool Github, the official solution is there : https://devdocs.magento.com/guides/v2.1/migration/migration-troubleshooting.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.