MySQL Enterprise Backup User's Guide (Version 8.0.37)

5.1.4 Table-Level Recovery (TLR)

For MySQL Enterprise Backup 8.0.20 and later: Table-Level Recovery (TLR) allows selected tables (or schemas) to be restored from a backup (be it a full backup, a partial backup, or a backup created using transportable tablespaces (TTS)) using the --include-tables and --exclude-tables options. The feature is also known as partial restore in this manual. Here are some general requirements for performing a TLR or partial restore:

Here are some limitations for a TLR or partial restore:

The following command restores the table cats in the pets schema from the backup:

Example 5.7 Restoring A Selected Table from an Image Backup

mysqlbackup --socket=/tmp/restoreserver.sock --include-tables="^pets\.cats" --backup-dir=/dba/backuptmp \
 --backup-image=/dba/my.mbi copy-back-and-apply-log

The following command restores all tables in the sales database from the backup, but excludes the table with the name hardware :

Example 5.8 Restoring Selected Tables in a Schema from an Image Backup

mysqlbackup --socket=/tmp/restoreserver.sock --include-tables="^sales\." \ 
  --exclude-tables="^sales\.hardware$" --backup-dir=/dba/backuptmp --backup-image=/dba/my.mbi \
  copy-back-and-apply-log

Also see Section 5.1.5, “Restoring Backups Created with the --use-tts Option” for additional information on partial restores using TTS backups.

Note

For MySQL Enterprise Backup 8.0.19 and before, partial restore is only supported for TTS backups.