Restore to new name

Hi,
I have a backup of a database, called ‘myDataBase’, and would like to restore it on the same server but under a different schema name. In other words after a restore I would like to have the original schema ‘myDataBase’ existing next to ‘myDataBase_copy’ and they are identical in everything but name. How can I do this?

Many Thanks

Mike

Hi Mike,

You can not directly do that but if you have innodb_file_per_table ON then you can use option like Import/Export tablespace option to restore tables in new database name from the backup.
http://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/importing_exporting_tables_ibk.html

Even, MySQL 5.6 supporting exportable tablespaces.
http://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/importing_exporting_tables_ibk.html

Thanks.