#1062 - Duplicate entry '8-938' for key 'PRIMARY' Error

Started by edwatki, January 24, 2013, 09:18:48 AM

Previous topic - Next topic

edwatki

I've moving my SMF from one domain to another.

I have exported two .sql files (the table structure and the data).

I have created a new database and imported the table structure ok using phpMyAdmin

When I try to import the data file I get the following error. I have not amended the file at all and tried exporting several times.

Please help.


QuoteError
SQL query:

# -------------------------------------------------------- # # Dumping data in `smf_log_search_subjects` # INSERT INTO `smf_log_search_subjects` (`word`, `ID_TOPIC`) VALUES ('#19', 944), (0, 938), (04, 885), (04, 1352), (05, 1161), (05, 1168), (06, 967), (07, 885), (08, 938), (08, 1005), (08, 1015), (09, 1140), (1, 891), (1, 1053), (1, 1147), (1, 1152), (1, 1273), (1, 1327), (1, 1349), (1, 1364), (1, 1395), (1, 1497), (1, 1500), (10, 1004), (10, 1254), (10, 1385), ('10th', 1142), (11, 1004), (11, 1055), (11, 1089), (11, 1161), (11, 1296), (11, 1312), ('11-inch', 1052), ('11th', 1338), (12, 1055), (12, 1123), ('12pm', 1053), ('12th', 953), ('13th', 953), ('14th', 1212), ('14th', 1245), (15, 938), (15, 1005), (15, 1015), (17, 967), (17, 1268), ('17th', 1243), (18, 1268), ('18th', 1173), ('18th', 1243), ('19-23', 1216), ('1st', 860), ('1st', 1009), ('1st', 1323), (2, [...]

MySQL said:

#1062 - Duplicate entry '8-938' for key 'PRIMARY'

kat

Why not do it the simple way?

If you go to CPanel>Files>Backups, for your old site, you can backup the home directory and the database.

Then, if you go to the new site's CPanel and restore both from the same page, in CPanel.

Saves all that messing around. :)

edwatki

For the original site I do not have control panel access. I only have PuTTy due to the way the server is setup.

As such no control panel or FTP on old site.

kat

Ah...

Out of curiosity, why didn't you export the entire database, in one hit?

Anyway... can you alter the column in the database, before import, to turn off auto-increment? Then you could import, again, You can always turn auto-increment on, again, once you've imported.

edwatki

Hi,

There is a option called:

"Do not use AUTO_INCREMENT for zero values"

I have tried importing with this both on and off. I get the same error both times.

Initially I tried exporting both together and got the same error. So to figure out if it was the table structure or the data I did them seperate. As I said the tabel structure works but not the data.

I really don't know what to do?

kat


edwatki

Any chance I could send someone the data to look at?

I've just spent 4 hours going through old posts and still get the same error. I'm really stuck.

Colin

I will have a look if you send me private message PHPMYADMIN credentials to the new site, the two database dumps, and a link your new site.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

edwatki

Thanks I will get this over to you asap.

Do you need a login to my PHPADMIN area?

Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

edwatki


ziycon

If you have putty access you can dump the database and then import it on the new database using the export and import commands.

Export
http://www.sqlface.com/syntax/mysql/export-database-dump/

Import
http://www.sqlface.com/syntax/mysql/import-database-dump/

Advertisement: