Jump to content

Duplicate entry '1-0' for key 'PRIMARY' - moving database to another server


tumil

Recommended Posts

Hi,

I'm migrating to a different server so I need to move my shop's database from the old one. I exported all database using the "Export" tab in phpmyadmin of the old server and exported it to an .sql file. But during import on the new server I get such error:

 



Zapytanie SQL:




INSERT INTO `ps_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`) VALUES
(1, 0, 1, 1, 1, 1),
(1, 1, 1, 1, 1, 1),
(1, 5, 1, 1, 1, 1),
(1, 7, 1, 1, 1, 1),
(1, 9, 1, 1, 1, 1),
(1, 10, 1, 1, 1, 1),
(1, 11, 1, 1, 1, 1),
(1, 13, 1, 1, 1, 1),
(1, 14, 1, 1, 1, 1),
(1, 15, 1, 1, 1, 1),
(1, 16, 1, 1, 1, 1),
(1, 19, 1, 1, 1, 1),
(1, 20, 1, 1, 1, 1),
(1, 21, 1, 1, 1, 1),
(1, 22, 1, 1, 1, 1),
(1, 23, 1, 1, 1, 1),
(1, 24, 1, 1, 1, 1),
(1, 25, 1, 1, 1, 1),
(1, 26, 1, 1, 1, 1),
(1, 27, 1, 1, 1, 1),
(1, 28, 1, 1, 1, 1),
(1, 29, 1, 1, 1, 1),
(1, 31, 1, 1, 1, 1),
(1, 32, 1, 1, 1, 1),
(1, 33, 1, 1, 1, 1),
(1, 34, 1, 1, 1, 1),
(1, 35, 1, 1, 1, 1),
(1, 36, 1, 1, 1, 1),
(1, 38, 1, 1, 1, 1),
(1, 39, 1, 1, 1, 1),
(1, 40, 1, 1, 1, 1),
(1, 41, 1, 1, 1, 1),
(1, 42, 1, 1, 1, 1),
(1, 44, 1, 1, 1, 1),
(1, 45, 1, 1, 1, 1),
(1, 48, 1, 1, 1, 1),
(1, 50, 1, 1, 1, 1),
(1, 52, 1, 1, 1, 1),
(1, 53, 1, 1, 1, 1),
(1, 54, 1, 1, 1, 1),
(1, 55, 1, 1, 1, 1),
(1, 56, 1, 1, 1, 1),
(1, 57, 1, 1, 1, 1),
(1, 58, 1, 1,[...]
MySQL zwrócił komunikat:


#1062 - duplicate entry '1-0' for key 'PRIMARY'


 

 

So that's the error I'm facing. I've translated the most important line because I have a Polish phpmyadmin.

Anyone?

Link to comment
Share on other sites

You probably tried to upload it before and time run out, your import was stoped and if You try upload it again then phpMyAdmin is showing You that this what You want to upload is already there.

You have to (choose one): 
a) Login and see where Your import stoped and try to upload the file from this line (there is such a function in phpMyAdmin)
B) Delete content of the database and try upload again - try to compress sql file to zip format.
c) Split sql file manually into few part and upload them one by one.

d) If You are not into databases etc it will be better to hire someone to do this for You.

Edited by hakeryk2 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...