Speeding up percona xtrabackup restores
I started playing around with using xtrabackup (or more specifically innobackupex) to backup MySQL. Most of our tables are now innodb so it didn’t make sense to keep dumping everything out via mysqldump.
I had a clone of our master db server in our virtual environment that I was trying to restore the backup onto, but it was taking hours (using innobackupex –copy-back /backup/). I figured that the IO on my virtual servers was just crap and I’d have to grin and bear it. There doesn’t seem to be much around about restoring using innobackupex, even the command options are limited for restores so I thought –copy-back was the only way.
It seems that if your backup is on the same filesystem as where it’s going to end up then it’s a lot faster to use the –move-back option. This changed my restore time from hours to seconds.
innobackupex –move-back /backup/