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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.