# Xtrabackutp restore on another server with another DB running on the same server

**URL:** <https://forums.percona.com/t/xtrabackutp-restore-on-another-server-with-another-db-running-on-the-same-server/3108>\
**Category:** Percona XtraBackup\
**Created:** [November 20, 2013, 1:13pm UTC](https://forums.percona.com/t/xtrabackutp-restore-on-another-server-with-another-db-running-on-the-same-server/3108 "2013-11-20T13:13:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajesh020285](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@rajesh020285](https://forums.percona.com/u/rajesh020285)\
**Post date:** [November 20, 2013, 1:13pm UTC](https://forums.percona.com/t/xtrabackutp-restore-on-another-server-with-another-db-running-on-the-same-server/3108/1 "2013-11-20T13:13:15Z")

</div>

Hi Guys,

We have a task to migrate a database to a new hardware where there is a active database on it already.

1. We have xtrabackup taking daily backups.
2. We have option to start/stop DB on the new hardware to complete the restoration.

I had followed the following process to test the migration ( Apparently it did not succeed )

1. Copy the .qp file to new hardware, uncompressed it .
2. Stop the mysql on the new server
3. Copy the data file of the database to be migrated to the datadir of the new server.
4. Start the mysql.

After this process I can see the database / tables but when try to access the tables I get an error

mysql\> desc ;  
ERROR 1146 (42S02): Table '" doesn’t exist  
mysql\>

I am looking at mysqldump option but that is taking way long time which is not good as downtime cannot be that long.

Any ideas on how I can use the existing xtrabackup file to restore it on existing DB ???

Any suggestions would be appreciated.

Thanks  
-Rajesh

---

<div class="post-metadata">

**Author:** ![mirfan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mirfan/32/16890_2.png) [@mirfan](https://forums.percona.com/u/mirfan)\
**Post date:** [November 20, 2013, 2:52pm UTC](https://forums.percona.com/t/xtrabackutp-restore-on-another-server-with-another-db-running-on-the-same-server/3108/2 "2013-11-20T14:52:05Z")

</div>

In order to restore database/tables on active database. You need to use [partial backups](http://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/partial_backups_innobackupex.html) i.e. backup selected database/tables first. You need to use --include, --tables-file or --databases option to backup selected database/tables.  
In order to restore partial backup couple of prerequisites you need to meet. Tables should be created with innodb\_file\_per\_table option enabled. i.e. each table data should reside on it’s own tablespace (.ibd) file and enable innodb\_expand\_import or innodb\_import\_table\_from\_xtrabackup depends on percona server version for the the last option. Further, those options need to be enable where you want to import the schema/tables.  
After that you need to prepare backup with --export option, then create tables manually where you need to import, discard the existing tablespace, Copy the .exp & .ibd files to the datadir and finally import the tablespace. Also, you can check this thread for help on it [url][http://www.percona.com/forums/questions-discussions/percona-xtrabackup/8315-restore-one-table-from-xtrabackup-s-full-backup[/url]](http://www.percona.com/forums/questions-discussions/percona-xtrabackup/8315-restore-one-table-from-xtrabackup-s-full-backup%5B/url%5D) and check the Xtrabackup partial backup documentation.  
I recommend to test it before applying it to production and create backup of active database.

Hope that helps.

---

<div class="post-metadata">

**Author:** ![rajesh020285](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@rajesh020285](https://forums.percona.com/u/rajesh020285)\
**Post date:** [November 20, 2013, 4:04pm UTC](https://forums.percona.com/t/xtrabackutp-restore-on-another-server-with-another-db-running-on-the-same-server/3108/3 "2013-11-20T16:04:33Z")

</div>

Thanks for the response Irfan, will be testing your suggestion and get back to you…

-Rajesh
