# XtraBackup Restore specific database since a full backup

**URL:** <https://forums.percona.com/t/xtrabackup-restore-specific-database-since-a-full-backup/8931>\
**Category:** Percona XtraBackup\
**Tags:** community, mysql, percona\
**Created:** [January 25, 2021, 11:56pm UTC](https://forums.percona.com/t/xtrabackup-restore-specific-database-since-a-full-backup/8931 "2021-01-25T23:56:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roderick](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roderick/32/2550_2.png) [@Roderick](https://forums.percona.com/u/Roderick)\
**Post date:** [January 25, 2021, 11:56pm UTC](https://forums.percona.com/t/xtrabackup-restore-specific-database-since-a-full-backup/8931/1 "2021-01-25T23:56:23Z")

</div>

Hi,

I’m having two problem.

1. IPreformatted text’m trying to restore a database from a backup full, but only me can restore all databases, Can us restore a database?

once the files have been transferred to the mysql directory I cannot recover the data, is there any other way to retrieve only one table?

Regards

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 26, 2021, 1:41am UTC](https://forums.percona.com/t/xtrabackup-restore-specific-database-since-a-full-backup/8931/2 "2021-01-26T01:41:16Z")

</div>

Hi @Roderick,  
Restoring a single table involves these steps:

1. xtrabackup --prepare --export --target-dir=/data/backups/
2. CREATE DATABASE restore;
3. CREATE TABLE restore.comman LIKE orig.comman;
4. ALTER TABLE restore.comman DISCARD TABLESPACE;
5. cp /data/backups/orig/comman.\* /var/lib/mysql/restore/
6. chown mysql:mysql /var/lib/mysql/restore/comman.\*
7. ALTER TABLE restore.comman IMPORT TABLESPACE;

---

<div class="post-metadata">

**Author:** ![Roderick](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roderick/32/2550_2.png) [@Roderick](https://forums.percona.com/u/Roderick)\
**Post date:** [January 26, 2021, 7:49pm UTC](https://forums.percona.com/t/xtrabackup-restore-specific-database-since-a-full-backup/8931/3 "2021-01-26T19:49:34Z")

</div>

Hi @matthewb

Thanks for support, perform the restore of database with the tables of way correctly.

Regards

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 26, 2021, 10:42pm UTC](https://forums.percona.com/t/xtrabackup-restore-specific-database-since-a-full-backup/8931/4 "2021-01-26T22:42:57Z")

</div>

I would say your backup is not accurate. You changed the schema after taking the backup. After you CREATE TABLE … LIKE …, drrop the new index before importing tablespace.

---

<div class="post-metadata">

**Author:** ![Roderick](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roderick/32/2550_2.png) [@Roderick](https://forums.percona.com/u/Roderick)\
**Post date:** [January 26, 2021, 11:48pm UTC](https://forums.percona.com/t/xtrabackup-restore-specific-database-since-a-full-backup/8931/5 "2021-01-26T23:48:46Z")

</div>

Hi @matthewb

Thanks, if you had a problem with the indexes but the table structure was recreated and it worked correctly.

Regards
