0

I understand I can use mysqldump or xtrabackup to move InnoDB from one db to another.

Considering I am okay with server down time, are there better way to move InnoDB database?

I have tried copying all "ib_*" files and seems does not work. Are there anything I've missed?

  • If you copy the entire tree, then it will go intact. Note that ibdata1 and iblog* are critical, as well as *.ibd and *.frm. But that is not much faster than dump/backup + simultaneous reload. – Rick James May 24 at 16:36
0

You might try using DRBD. It's a block-level replication technology that will synchronously (or asynchronously, if replicating over a distance) create a raid-1 relationship between two or more nodes.

DRBD can be used not only with newly allocated storage, it can also replicate existing volumes - provided you can either extend that volume to make room a small amount of metadata at the end, or have another volume attached that you can use as dedicated metadata storage. Dedicated metadata is easier to remove if you only intend to use this temporarily.

The process would generally involve establishing a DRBD device on each node that stores your tables, shutting down the database on one side, then immediately starting it on the other - with identical data.

  • It will, but only the amount of time it takes to stop the database, remount its filesystem using the DRBD device rather than the backing device, then start the database. Most of that time will likely be spent stopping and starting the database. – Spooler May 24 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.