Restoring Binary Mode Backup without Prepare
If you have done your backup with the prepare
keyword on the plugin
directive you should go back to the previous section section as the
restored backup prepare has already been done.
Once you have restored the backup content with Bacula, files using the
tar
format should be extracted with tar -i
option. With
xbstream format, if you didn’t choose automatic extraction with
restore_extract
or extract_restored_xbstream
, you can extract
data with the -x
option.
% cd @MYSQL/main
% xbstream -x < all-databases.xbstream
% ls
all-databases.xbstream ibdata1.delta performance_schema
xtrabackup_logfile ibdata1.meta testdb
backup-my.cnf xtrabackup_checkpoints mysql
xtrabackup_binary xtrabackup_binlog_info
When the files are uncompressed you can prepare the backup with the
--apply-log
option of the innobackupex
tool. If you plan to apply
incremental backups, you need also to use the --redo-only
option.
For MariaDB the mariabackup
command must have the --innobackupex
parameter so that it will mimic innobackupex
below.
% innobackupex --apply-log --redo-only $PWD
...
120604 02:50:02 innobackupex: completed OK!
Each Incremental should be extracted in a specific directory, then they should be applied to the base data.
% mkdir incr1
% cd incr1
% xbstream -x < ../all-databases-1220202.xbstream
% cd ..
% innobackupex --apply-log --redo-only --incremental-dir=incr1 $PWD
...
120604 02:51:02 innobackupex: completed OK!
% mkdir incr2
% cd incr2
% xbstream -x < ../all-databases-1320402.xbstream
% cd ..
% innobackupex --apply-log --redo-only --incremental-dir=incr2 $PWD
...
120604 02:52:02 innobackupex: completed OK!
When the files are uncompressed you can prepare the backup with the
--apply-log
option of the innobackupex
tool:
% innobackupex --apply-log $PWD
...
120604 02:51:02 innobackupex: completed OK!
Now the files in the local directory are ready to be used by the server.
The --copy-back
option will copy the prepared data back to its
original location as defined by the datadir in your my.cnf
. Note
that you can use --defaults-file=/path/to/my.cnf
to specify the
my.cnf
configuration file.
% innobackupex --copy-back $PWD
...
120604 02:58:44 innobackupex: completed OK!
You should check the file permissions after copying the data back. You may need to adjust them with something like:
% chown -R mysql:mysql /var/lib/mysql
Now the datadir contains the restored data. You are ready to start the server.
See also
Go back to:
Go back to the Restoring Complete Server Using Binary Mode (Percona).
Go back to the Restore page.
Go back to the main Operations page.