Magento – Import Database Error: #1062 Duplicate entry ‘3-13-70-0’ for key

databaseduplicateimportmagento-1.9

I am attempting to export the Magento database from my current installation to a test installation before I have the test installation go live. Both installations are version 1.9.2.1. I can successfully export the database. I've tried two methods of importing it. The first via SSH after uploading it via FTP to the server. The next via phpMyAdmin after exporting it as a gzip file first. I have to do it via a gzip file for phpMyAdmin because the database is way too big otherwise. For both SSH and phpMyAdmin, I get this same error with trying to import the database…

SQL Import Error

When done via SSH, the line in the picture under "My SQL said:" is what appears. phpMyAdmin seems to show a little more info. I have no idea what this error is all about. I emptied all of the logs from the tables as well as the admin notifications table. I just can't understand where this error is coming from.

Am I missing something? Do I need to delete all of the tables from the target database before importing the one from my live site? I feel like there's something simple that I'm overlooking or not doing correctly.

Best Answer

Yes, faced this issue quite often while migration of Magento databases. You need to check & remove all the duplicate entries from the SQL file manually. You could also look for the mg_catqalog_category_entity_decimal from phpMyAdmin and check for the foreign key checks.

Related Topic