i have doubts about xtrabackup --apply-log. is there any difference when use it? should it be done right after dump or before restore (even few months later)? seems stupid, but maybe i missing something.

documentation says this:

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.

thanks for help :)

3 Answers 3



You need to decide which protocol works best for you


Run --apply-log immediately after backup, and you would have the most currently full backup. You would not have to spend your recovery time applying applying logs at the time of a restore (especially at an actual disaster recovery event). Thus, recovery would be only focus at such a dire time.


This might work to your advantage if and only if you do not need the transactions that were accumulated after the point-in-time start of the backup. Such a situation would hardly make sense in a write-heavy environment.

Perhaps under these circumstances it would be better

  • Scheduled downtime
  • Small enough dataset
  • Acceptable window of time to backup (short time)
  • Additional backup of binary logs (extra insurance)


Whichever way one choose, make sure all the logs are good. If you apply the logs immediately, you'll know right then and there if the transaction logs are corrupt or not.

You also need to take into account how transaction-heavy the production system is. Why?

If the backup is recording incoming transactions as fast or faster than the backup process, then you have no choice but to go with PLAN B.


The chief reason to use --apply-log until the time of restore is to support incremental backups.

If you make incremental backups, you would use --apply-log --redo-only each incremental backup, and then just before you restore, you do a final prepare with --apply-log.

Otherwise if you don't make incremental backups, there's no reason not to do --apply-log right after you make the back up. Then it's ready to restore on a moment's notice.


found answer here. short is "you can do apply-log whenever you want", more useful information in link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.