Title: Issue with Database Duplicate Key
Last modified: May 18, 2021

---

# Issue with Database Duplicate Key

 *  [naijacenter](https://wordpress.org/support/users/naijacenter/)
 * (@naijacenter)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/issue-with-database-duplicate-key/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fissue-with-database-duplicate-key%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/issue-with-database-duplicate-key/#post-14418039)
 * See if this points in right direction [https://dba.stackexchange.com/questions/46803/1062-duplicate-entry-but-there-are-no-duplicates](https://dba.stackexchange.com/questions/46803/1062-duplicate-entry-but-there-are-no-duplicates)
 *  Thread Starter [naijacenter](https://wordpress.org/support/users/naijacenter/)
 * (@naijacenter)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/issue-with-database-duplicate-key/#post-14421684)
 * 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](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/issue-with-database-duplicate-key/#post-14423354)
 * 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.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/issue-with-database-duplicate-key/#post-14423354)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
