Documentation Home
MySQL Enterprise Backup 8.0 User's Guide
Related Documentation Download this Manual
PDF (US Ltr) - 1.4Mb
PDF (A4) - 1.4Mb


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

Requirements for restoring backups created with transportable tablespaces (TTS) (that is, created with the --use-tts option) are similar to those listed in Section 5.1.4, “Table-Level Recovery (TLR)”, with some differences noted in the section. The following is some additional information on partial restores using TTS backups

To backup and restore backups created using TTS, extra privileges are required of the user through which mysqlbackup connects to the server; see Section 4.1.2, “Grant MySQL Privileges to Backup Administrator” for details.

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.

You can rename a table when restoring it from a TTS backup by using the --rename option (the option is not supported for non-TTS backups):

Example 5.9 Restoring and Renaming a Table from a TTS Backup

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

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

# A table can be restored into another database; the target database is created if it is not existing on the server:
mysqlbackup --socket=/tmp/restoreserver.sock \
  --backup-dir=/BackupDirTemp --backup-image=/home/user/dbadmin/backups/tts-backup.mbi \
  --include-tables="^sales\.cars" --rename="sales.cars to new_sales.autos" copy-back-and-apply-log