Error migrating MySQL database

Error migrating MySQL database

Posted by: childofwonder
Posted on: 2006-03-07 08:24:00

I'm trying to transfer over my phpBB database from my home server to Dreamhost.

I've used the mysql command in SSH to restore the database but immediately get the following error:

ERROR 1062 (23000) at line 23: Duplicate entry '2' for key 1

The only thing I can think of is my config.php on my home server calls for a mysql database and on Dreamhost it lists mysql4.

Any suggestions? Thanks.

Re: Error migrating MySQL database

Posted by: Twirp
Posted on: 2006-03-07 15:09:00

check to see if there is something set as Primary or Unique that has 2 of the same value for it.

Re: Error migrating MySQL database

Posted by: childofwonder
Posted on: 2006-03-08 10:39:00

I think my problem is that my backup is a phpbb backup (phpbb_db_backup.sql) and is almost nothing but INSERT commands so some of the tables already exist in the new database.

I tried running the restore with a 1.7MB gzipped file using the phpBB control panel and it says restore complete but nothing changes save for the old categories showing under Forum Management but no Forums, users, posts, etc.

A clean database won't work, either.

:P

I wish I had used phpMyAdmin to backup the database on my home server.

Re: Error migrating MySQL database

Posted by: vicm3
Posted on: 2006-03-08 11:27:00

Try adding a -f on your command
mysql -f
from the manual
-f|--force
Continue even if the face of a SQL error.

I have found problems like that one on phpbb from time to time... adding the -f restores de DB, so you can work on it.

Fixing the repeating key is another matter (but I don't think that stop you from using phpbb)

Regards



Re: Error migrating MySQL database

Posted by: childofwonder
Posted on: 2006-03-08 16:14:00

You're my hero, man.

lol

That did the trick! It's always something simple!

Thanks!

Tags: mysql databasedreamhostconfig phpsshphpbberror error