Mysql – Restore Percona Xtrabackup to new database

innodbMySQL

I'm afraid that this question may be a duplicate, but I cannot find it being asked anywhere else. If it is a duplicate, please direct me to the thread where it is answered.

We are using the Percona Xtrabackup (innobackupex) to back up our very large database. We need to import this backup into a new database on the same server (We are backing up DB A on Server 1 and want to import it back into DB B on Server 1). How do we do this? I tried creating DB B and copying the data files into the directory but it didn't seem to work.

I'm not that familiar with InnoDB and don't want to risk taking our live database down by making a mistake on this (I've had issues with crashing InnoDB engine before and not being able to get it back up)

We are calling innobackupex in probably the simplest method possible:

innobackupex --no-timestamp /root/tmp/databases/

Best Answer

If you are trying to copy all the data from one schema into another schema using XtraBackup there is a blog post on the MySQL Performance Blog that describes how you can do it titled Migrating between MySQL schemas with Percona Xtrabackup.

This is one of the few cases not documented in the manual.