0

Transferring my website database from 1.9.2.2 to 2.2.3 is successful. However if I then export and import again my database with foreign key checks enabled the below error is displayed.

-- Constraints for table eav_entity_store -- ALTER TABLE eav_entity_store ADD CONSTRAINT EAV_ENTITY_STORE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID FOREIGN KEY (entity_type_id) REFERENCES eav_entity_type (entity_type_id) ON DELETE CASCADE, ADD CONSTRAINT EAV_ENTITY_STORE_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE CASCADE

MySQL said: **#1452 - Cannot add or update a child row: a foreign key constraint fails (mydatabase.#sql-44f8_43, CONSTRAINT EAV_ENTITY_STORE_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE CASCADE)

As I understand EAV_ENTITY_STORE is the increment of ID's for orders, invoices, credit memos and shipments. The foreign key relates to eav_entity_type which defines the type of entity

5 = Order 6 = Invoice 7 = Credit memo 8 = Shipment

magento eav_entity_store

I only have one store on the new website

enter image description here

Is the problem that there is no longer store_id=2 and is it safe to just delete this? I know i could just import with foreign key checks disabled but I would like to avoid doing this as it normally creates problems later.

  • is it the complete error log ? i think this issue is related to orphan tables ,, if yes than have a look github.com/magento/data-migration-tool/issues/213 – inrsaurabh Mar 27 '18 at 4:03
  • hi yes it is the complete error log, migration is successful so i don't think it is related to that, I appreciate your help though – Stuart Mar 27 '18 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.