Not the answer you need?
Register and ask your own question!

Procedure to restore a single database from a full innobackupex backup

SQLGuySQLGuy ContributorCurrent User Role Beginner
After working with innobackupex I've become familiar with what it takes to do backups and restores. But I have a question about restoring a single database from a full backup. According to the docs, here is the procedure:

1. Apply the log to the backup with the --export option to create the .exp (for Percona) and .cfg (for Community) InnoDB tables.
2. Drop the target database and recreate its DDL only using the DDL that was in existence when the backup was taken (we create this DDL script programmatically during the backup process).
3. Discard the tablespaces for the InnoDB tables in the target database.
4. Copy the .ibd and .exp files from the backup to the target folder (as stated here: https://www.percona.com/doc/percona-...ables_ibk.html)
5. Import the tablespaces for the InnoDB tables.

My question is about #4 above. First of all, if we only copied the .ibd and .exp files that would miss all the MYISAM tables if any existed. Second, why not just copy EVERYTHING from the backup folder (for that database) to the target database folder instead? That would make the restore a lot simpler. I've tried this and it seems to work fine. Here are the file types in the backup folder:

.exp (for restoring to Percona XtraDB Servers)
.cfg (for restoring to Community Servers)
.ibd (InnoDB table)
db.opt (the database options file)
.frm (table format file)
.MYD (MYISAM table)
.MYI (MYISAM index)
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.