Title: SQL Database upload error
Last modified: August 24, 2016

---

# SQL Database upload error

 *  [hmistler](https://wordpress.org/support/users/hmistler/)
 * (@hmistler)
 * [11 years ago](https://wordpress.org/support/topic/sql-database-upload-error/)
 * Hello – one of my old domains & hosting expired and unfortunately I lost the 
   site (got no warning from the account…grr). I have a SQL file backup of the site,
   and I followed the instructions to upload it from here:
 * [http://codex.wordpress.org/Restoring_Your_Database_From_Backup](http://codex.wordpress.org/Restoring_Your_Database_From_Backup)
 * All goes well until I get this very long winded error message.
    Error:
 * SQL query: Documentation
 * — — Dumping data for table `wp_customcontactforms_fields` — INSERT INTO `wp_customcontactforms_fields`(`
   id`, `field_slug`, `field_label`, `field_type`, `field_value`, `field_maxlength`,`
   user_field`, `field_instructions`, `field_options`, `field_required`, `field_class`,`
   field_error`, `field_max_upload_size`, `field_allowed_file_extensions`) VALUES(
   1, ‘captcha’, ‘Type the numbers.’, ‘Text’, ”, 100, 0, ‘Type the numbers displayed
   in the image above.’, ‘a:0:{}’, 0, ”, ”, 0, ”), (2, ‘recaptcha’, ”, ‘Text’, ”,
   100, 0, ‘Type the numbers displayed in the image above.’, ‘a:0:{}’, 0, ”, ”, 
   0, ”), (3, ‘usaStates’, ‘Select a State’, ‘Dropdown’, ”, 0, 0, ”, ‘a:0:{}’, 0,”,”,
   0, ”), (4, ‘allCountries’, ‘Select a Country’, ‘Dropdown’, ”, 0, 0, ”, ‘a:0:{}’,
   0, ”, ”, 0, ”), (5, ‘ishuman’, ‘Check if you are human.’, ‘Checkbox’, ‘1’, 0,
   0, ‘This helps us prevent spam.’, ‘a:0:{}’, 0, ”, ”, 0, ”), (6, ‘fixedEmail’,‘
   Your Email’, ‘Text’, ”, 100, 0, ‘Please enter your email[…]
 * MySQL said: Documentation
    #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
 * Does anyone have any clue why this wouldn’t work for me?

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

 *  [Lalit Nagrath](https://wordpress.org/support/users/laliz/)
 * (@laliz)
 * [11 years ago](https://wordpress.org/support/topic/sql-database-upload-error/#post-6019224)
 * >  #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
 * Primary key cannot have a duplicate value(id).
 * > VALUES (1, ‘captcha’, ‘Type the numbers.’
 * either remove this whole query or replace id field(quoted above, with value 1)
   with some integer which wount repeat for this table.
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [11 years ago](https://wordpress.org/support/topic/sql-database-upload-error/#post-6019247)
 * That sounds like you already have values in that table,. If you do you can either
   remove the INSERT statement from your import, change the ID’s to be unique, or
   empty out the existing values in the table before you import the new ones.
 *  Thread Starter [hmistler](https://wordpress.org/support/users/hmistler/)
 * (@hmistler)
 * [11 years ago](https://wordpress.org/support/topic/sql-database-upload-error/#post-6019262)
 * I’ve never done this before so this is all new! I did install wordpress on the
   site & started fooling around with some posts; that’s when I decided to just 
   upload the old version. So would I have to remove WordPress from the site & try
   this again? Or just remove the content I have (like posts, images, etc.) but 
   keep the theme? I’m not sure what I would need to get rid of in order for the
   restoration to work…thanks so much
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [11 years ago](https://wordpress.org/support/topic/sql-database-upload-error/#post-6019263)
 * Ok, that is a bit differnet, but actually might be eaiser!
 * For the file,s you’d just upload everything that you have to the server – but
   be sure that you don’t overwrite the existing `wp-cinfig.php` file with your 
   database settings in it.
 * For the database, go into phpMyAdmin, and DROP all of the current tables. Then
   you can import the SQL dump file and you won’t (at least shouldn’t…) get any 
   errors.

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

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

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/sql-database-upload-error/#post-6019263)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
