Search code examples
backupdatabase-backupsperconaprepare

Percona XtraBackup "create" vs "prepare" backup


I'm trying to understand XtraBackup and I can't really get the difference between creating a backup and preparing it. Preparing for what? I've created a backup, what for is the preparation? Does it anyway need to be prepared? E.g. here


Solution

  • http://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/innobackupex_option_reference.html to option --apply-log

    -apply-log Prepare a backup in BACKUP-DIR by applying the transaction log file named xtrabackup_logfile located in the same directory. Also, create new transaction logs. The InnoDB configuration is read from the file backup-my.cnf created by innobackupex when the backup was made. innobackupex –apply-log uses InnoDB configuration from backup-my.cnf by default, or from –defaults-file, if specified. InnoDB configuration in this context means server variables that affect data format, i.e. innodb_page_size, innodb_log_block_size, etc. Location-related variables, like innodb_log_group_home_dir or innodb_data_file_path are always ignored by –apply-log, so preparing a backup always works with data files from the backup directory, rather than any external ones.