MySQL Enterprise Backup User's Guide (Version 4.1.4)

5.1.4 Restoring Backups Created with the --use-tts Option

There are some special requirements for restoring backups created with transportable tablespaces (TTS) (that is, created with the --use-tts option):

When restoring a single-file backup created with the option setting --use-tts=with-minimum-locking, the folder specified with --backup-dir, besides holding temporary output, status files, and metadata, is also used for extracting temporarily all the tables in the backup and for performing an apply-log operation to make the data up-to-date before restoring them to the server's data directory.

Selected tables can be restored from a backup created with transportable tablespaces (TTS) using the --include-tables and --exclude-tables options. The following command restores all tables in the sales database from the backup, but excludes the table with the name hardware :

Example 5.7 Restoring Selected Tables from a TTS Image Backup

mysqlbackup --socket=/tmp/restoreserver.sock --datadir=/logs/restoreserverdata --backup-dir=/logs/backup \
  --include-tables="^sales\." --exclude-tables="^sales\.hardware$" copy-back-and-apply-log

This following commands rename a table when restoring it from a TTS Backup by using the --rename option:

Example 5.8 Restoring and Renaming a Table from a TTS Backup

# Using fully qualified table names:
mysqlbackup --socket=/tmp/restoreserver.sock --datadir=/logs/restoreserverdata \
   --backup-dir=/BackupDirTemp --backup-image=/home/dbadmin/backups/tts-backup.mbi \
  --include-tables="^sales\.cars" --rename=" to" copy-back-and-apply-log

# It works the same if database names are omitted in the argument for --rename:
mysqlbackup --socket=/tmp/restoreserver.sock --datadir=/logs/restoreserverdata \
  --backup-dir=/BackupDirTemp --backup-image=/home/dbadmin/backups/tts-backup.mbi \
  --include-tables="^sales\.cars" --rename="cars to autos" copy-back-and-apply-log