• dear developer,

    I am having a huge and unfamiliar challenge with my website. I am not very tech-savvy, I know the basic WordPress stuff.

    Yesterday, my working website started showing error, and I attempted to restore back up with godaddy. I have a paid backup with them.

    I tried to retore the 7th of May but I keep getting this error “MySQL said: Documentation

    #1062 – Duplicate entry ‘41360055’ for key ‘PRIMARY'”

    I have tried to create a new database to restore it, it shows the same problem. I have downloaded the backup and import, none works. I dont know what to do.

    Can someone farmiliar with this help out? Please note that whatever suggestion must be done basically for a layman understanding. Kind regards.

    Please help.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    Thread Starter naijacenter

    (@naijacenter)

    It is all a foreign language to mem what could cause such a thing, particularly when no update it file added?

    My site has been down since Friday and am very helpless about it.

    I was told a developer, which I am not, can help to resolve this. Is WordPress support please help?

    Moderator bcworkz

    (@bcworkz)

    Is there more information about where that error occurred? Like table name at least, and hopefully field/column name as well.

    The issue is any PRIMARY column may not contain duplicate entries. Usually this column’s data is something that must be unique for each record, like an ID. In WP, this is likely the column ID or something similar.

    There’s a good chance the entire record (row) is a duplicate and one of the copies could be safely removed. But I suspect that will not be the only duplicate. I think that perhaps the backup was appended to the original data instead of replacing it. If that is what happened, it’s not something that can be patched up manually by deleting a duplicate row here and there. There are too many records involved.

    Here’s what I recommend doing IF there are indeed very many duplicates: Make a new, complete backup of the entire WP database, just for safety. Be sure you don’t overwrite the earlier backup. The current database is unusable, but it’s better to have a broken backup than no backup.

    From here, proceed at your own risk. If not done carefully, you could lose a lot of data. That’s why you need a new backup, but backups have been known to fail to restore correctly. Bear in mind you’re taking advice from a random stranger on the internet. That’s risky in itself. I believe this to be the best path forward if there are a lot of duplicates, but I’m not the one taking a risk and I assume no liability if things go wrong. TBH, it’d be much safer to hire a professional to fix this for you, but in fact the procedure isn’t that complicated. Just don’t attempt to hire anyone through these forums, it’s not permitted.

    Still willing to proceed? You’re very brave! But with a broken database, I suppose there’s not much more to lose.

    Here’s the scary part: Drop (delete) all tables in the WP database. This ensures the backup cannot be appended to existing data. This is done through the phpMyAdmin app, usually accessed through your hosting account. Keep the database itself, just empty it of all tables.

    Restore the tables from your last known good backup. Not the one you just made. If all goes well, your site will be back again, just as it was when the backup was made. Any changes, if any, made after this backup will be lost.

    I expect you’ll have more questions. I’ll do my best to answer.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Issue with Database Duplicate Key’ is closed to new replies.