简体   繁体   中英

can't import a magento database

i have a magento database which seems to be corrupted. so i want to repair it. but before i start repair i want to back up the existing database. but when i try to backup the database by exporting it and later try to import it, it gives errors like "#1062 - Duplicate entry '1' for key 'PRIMARY' "

i simply can't take the backup. i tried copying the database from phpmyadmin as well but still same problem and there is no way i can take risk by attempting the repair on the existing database as it is being used in live website.

can anyone suggest what can be done?

It is not much of a Magento question, but more of a general export/import on a live site. What I would suggest is to make export and then import to another clean database, and then rename the old one to "*_old" and new clean to the original name.

Of course, for some time the site would be down and there could be a little user sessions data lost, but if you tell your users about maintenance in advance, it shouldn't be a major problem.

Also what I would suggest is to test this approach on a localhost somewhere and only then on a live site. And of course, have all backups just in case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM