Let me first explain how the redo logs are used in backup and restore in general.
As changes are made on a running ZCS server, they are logged to the /opt/zimbra/redolog/redo.log file. When it reaches a certain size, it is closed and moved to /opt/zimbra/redolog/archive directory, and a new redo.log is opened. Thus redo logs pile up in the archive directory. Then, incremental backup moves all archive/* redo logs to backup directory.
Restore always starts with data in a full backup. Then all redo logs in incremental backups since the full backup are processed to replay the changes. When all incremental backups are processed, redo replay moves to the logs in /opt/zimbra/redolog/archive. Finally, the /opt/zimbra/redolog/redo.log file is processed to bring things up to the present. Various options can be passed to the restore command to control exactly where to stop the replay, achieving point-in-time recovery.
So, in your disaster recovery scenario, you have full backup and incremental backup available copied to a server, your ZCS server crashed and a spare machine was put in. How to restore to the most recent time, assuming the crashed server's hard disk is readable?
On the new ZCS server, copy over the full and incremental backups or mount them. Let's say you mounted it at /zcsbackup. So you have /zcsbackup/sessions/full-..., incr-..., and so on. You can then stop ZCS and copy over the contents of /opt/zimbra/redolog directory from crashed server to the new server. Copy over both redo.log and archive/*.
Then in the zmrestore or zmrestoreoffline command, specify "-t /zcsbackup" to indicate where the full/incremental backups are. Also, do *not* specify "-br" options. If you specify it, redo log replay stops after the incremental backups. Also don't specify "-rf" option. That option will restore only to the full backup.
Every redo log file has a sequence number. For replay to work correctly, all redo logs that are replayed must have consecutive sequence without gap. This should always be the case on a normally running system. So the main trick in your scenario is to get the backup and redolog directory contents to look as if everything is normal. |