I tried to move Magento site from sub-doamin into new main domain.

when I tried to import a database, I got following error :

"Magento Cannot add or update a child row: a foreign key constraint fails importing database"

i am beginner in Sql, please help me to find solution.

thanks in advance.


You can add SET FOREIGN_KEY_CHECKS=0 at the beginning of your db dump, but I'm afraid this will only solve your import problem.
Your db will still have zombie records.
Just to be on the safe side try to export the db with the tool provided by Magento: System->Tools->Backup.

  • hi, thanks a lot for your help. you are my life saver as always.... thanks again, again and again.... – Baby in Magento Sep 3 '14 at 14:21

Your Answer

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

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