Error migrating MySQL database


#1

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.


#2

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


We’re [color=#0000CC]DreamingOfYou[/color] :wink: Use PromoCode PerfectDream to save you the most?


#3

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.

:stuck_out_tongue:

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


#4

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


#5

You’re my hero, man.

lol

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

Thanks!