Title: Database import error
Last modified: July 25, 2020

---

# Database import error

 *  Resolved [Wes](https://wordpress.org/support/users/wes/)
 * (@wes)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/database-import-error-4/)
 * So I’d been trying to update my website with a SSL certificate, and in the process
   of doing so I noticed a crapton of errors. The automatic update wasn’t working,
   so I manually updated WordPress to 5.4.2. Then I noticed I couldn’t edit any 
   of my theme files internally and no plugin settings were being saved, even after
   disabling all of them. Ultimately it seemed like the problem was that my database
   was full — the stats in my webhost control panel said I was using 150MB/100MB—
   such that the server wasn’t allowing me to write any new data to it. And when
   it seemed like the issue was that the comments table had 140MB of overhead, I
   couldn’t even optimize it because apparently that also required writing some 
   value.
 * So it seemed like a good idea to clear the database and try to restore from a
   backup.
 * FML.
 * Anyway, I emptied the database and made a backup. Tried restoring — but kept 
   getting an error that caused it to abort. Wondered if it had something to do 
   with the space thing, so I created another database with a 1000MB limit (apparently
   since I created that first database years the host increased their size limits???)
   and tried again. Same error. Same error when I tried restoring from the backup
   I made before the manual update, and same error when I tried restoring from the
   backup I made the last time I edited the site (in Dec 2018; it’s been a while).
 * Anyway, here’s the error:
 * SQL query:
 * INSERT INTO `scblog_posts` VALUES (4070, 1, ‘2016-04-11 00:44:50’, ‘2016-04-11
   04:44:50’, ”, ‘robug08’, 0, ”, ‘inherit’, ‘open’, ‘closed’, ”, ‘robug08’, ”, ”,‘
   2016-04-12 02:21:40’, ‘2016-04-12 06:21:40’, ”, 4043, ‘[http://www.scary-crayon.com/blog/wp-content/uploads/2016/04/robug08.jpg&#8217](http://www.scary-crayon.com/blog/wp-content/uploads/2016/04/robug08.jpg&#8217);,
   0, ‘attachment’, ‘image/jpeg’, 0)
 * MySQL said: Documentation
    #1062 – Duplicate entry ‘4070’ for key ‘PRIMARY’
 * Any suggestions? Thank you so much for any help you can provide.
    -  This topic was modified 5 years, 8 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Everything else WordPress
      topic
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdatabase-import-error-4%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [Wes](https://wordpress.org/support/users/wes/)
 * (@wes)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/database-import-error-4/#post-13168786)
 * Okay, so I got everything working again… apparently what was required was for
   me to manually edit the sql file and remove all of the duplicate entries. There
   were many, all in the posts table. Not sure how that happened. But things work
   now! Hurray. <3

Viewing 1 replies (of 1 total)

The topic ‘Database import error’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [fml](https://wordpress.org/support/topic-tag/fml/)
 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Wes](https://wordpress.org/support/users/wes/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/database-import-error-4/#post-13168786)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
