Jump to content

[SOLVED] Moving an InnoDB tables to a different server


s0c0

Recommended Posts

I had to move to some InnoDB tables to a different server today and it didn't work cause of all the foreign key constraints.  We tried using mysqldump and copying the actual files over to the new server all of which failed.  I were rather afraid to copy the ibdate file which was suggested by the MySQL site http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html.

 

What I instead did was copy the table structures over as MyISAM.  Then add all the data over.  Then finally I did all the alter statements to add my foriegn key constraints, indexing etc...  This worked, but dear god there has to be an easier way next time.

What options did you use for mysqldump? I have this in a shell script for InnoDB:

mysqldump \

-u root \

-p \

--skip-opt \

--single-transaction \

--add-drop-table \

--create-options \

--quick \

--extended-insert \

--set-charset \

--disable-keys \

$1 > $dump_file

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.