Zimbra Disaster Recovery with Zextras Suite | Zimbra

Document
Alert! This article is written for Zimbra OSE users. As of December 2023, Synacor will no longer be providing support for Zimbra OSE. You might want to consider trying out Carbonio Community Edition – Zextras’s free and open-source email and collaboration platform.

For additional guidance, check out our community articles detailing the process of migrating from your current platform to Carbonio CE.

For enterprise-level requirements and advanced features, consider checking out Zextras Carbonio – the all-in-one private digital workplace designed for digital sovereignty trusted by the public sector, telcos, and regulated industries.

Step by step guide to Zimbra Disaster Recovery using Zimbra suite.

How to manage a disaster recovery in Zimbra

In a previous article, we’ve seen some disaster scenarios that can occur and some traditional disaster recovery solutions, as well as an overview of Zextras solution.

With the following article, however, we want to go over how Disaster Recovery solution works with the help of Zextras Backup and why it is actually efficient.

How to Recover after a Disaster

So the disaster happens, although you were sure you had taken every precaution. And I’m not only talking about natural disaster, but just thinking about, for example, hardware failure of a vital filesystem (or more than one) or of the physical machine hosting Zimbra, or contents of a vital filesystem made unusable by different kind of factors (both internal or external), or critical failure of software or OS.

Well, not all is lost. We can proceed to service recovery with the help of Zextras Backup.

How can Zextras Backup Help?

With Zextras Backup we can easy and safely perform the second recovery step, using the Import Backup feature. It allows you to restore a basic Zimbra installation to the last valid time from your old server, simply using its backup path as the import one. But this is just a possible scenario.

Let’s see now how the recovery process works:

After installing and configuring Zimbra on a new server, install Zextras Suite. After completing those steps, mount the backup folder from the old server to the new one. Now start the External Restore on the new server using the following command:

zxsuite backup doExternalRestore /path/to/the/old/store

This operation will immediately, as a first step, create domains, accounts and distribution lists, so the system will be ready for your users. After this one, a second step will restore Emails and other mailbox items.

If your backup is on a third party storage, then you need to proceed as follows:

If the backup was on S3, create a new bucket configuration with the same settings as the old one, without configuring it as the BLOB store. Otherwise mount the remote folder. Then retrieve the metadata using the following command:

zxsuite backup retrieveMetadataFromArchive {source} {destination}

After doing that use the blobArchive option when running the External Restore to make sure that the operation will retrieve the BLOBs from the old backup.

If the backup folder from the old server is not available, well … you could still use an older copy of the backup folder, if you have one. (of course only old items will be restored)

Configurations

Please note that although Server and Global settings are backed up, they are not automatically restored.

Zextras Backup, thanks to its high-level integration with Zimbra, allows you to restore your data also on a server with a different environment, such as different OS or Zimbra Release from the old one. You need nothing but the minimum Zimbra version required to run Zextras Suite.

A very convenient CLI command, comes with Zextras Backup to help you either you want to create a perfect copy of the old server or take its settings to adapt them to a new environment. That is getServerConfig.

To learn more about how this command works, we suggest you read our documentation.

Disaster Recovery with VMs and Snapshots

Thanks to the advent of highly evolved virtualization solutions in the past years, virtual machines are now the most common way to deploy server solutions such as Zimbra Collaboration Suite. In case of a disaster, it’s always possible to roll back to the latest snapshot and import the missing data using Zextras Backup External Restore feature, using the server’s backup path as the import path.

Please note that when you are using these kinds of systems, it’s crucial to be sure that the Backup Path isn’t either part of the snapshot or altered in any way when rolling back in order for the missing data to be available for import.

You can also perform a disaster recovery from a previous VM State. In order to do that with Zextras Backup, you need to proceed as follows:

First of all you have to restore the last valid backup into a different VM in an isolated network, being sure that users can’t access it and there is no active mail traffic. Then, after switching on the clone and waiting for Zimbra to start, disable Zextras Backup’s RealTime Scanner.

Now connect the virtual disk containing the untainted backup path to the clone and mount it (of course on a different path). At this point you can start an External Restore using the Backup Path as the Import one.

By doing this, all items in the backup path will be analyzed and the missing ones imported. This will speed up disaster recovery. You can repeat these steps as many times as necessary.

Suggestions

Since, as we have described in this article about email back-up, prevention is better than cure, here are some small tips to reduce the chances of disaster:

  • Always keep critical file systems on different drives
  • Use a monitoring tool for your server so that you are alerted in time of any anomalies or errors as soon as they occur
  • Carefully plan updates and migrations
Download Zextras Suite for Zimbra OSE

Comments

JDunphy
06/14/2021

A few question on this as I am practicing various recovery strategies so very new to using your backup/restore tool using this external restoration method.

I noticed that after provisioning the accounts (provisioning_only TRUE) and then provisioning the external backup for multiple accounts (concurrent_accounts 5) that data didn't seem to arrive from latest to oldest for my empty account. Is there a way to modify that behavior? I was testing my account which has data from 2005 so there was a lot of email in the process of being restored and the entire process was fairly long to finish. Ideally, the only data I required immediately was my recent data and not those older messages from 2005 so was wondering if there was a best practice or switch to change the priority of what is restored?

The other question is about unattended restoration.  I have the OS and default zimbra system installed and configured with no interactive keystrokes from a script but each zxsuite command looks like it will require that I either parse the log given in the output of executing the zxsuite command or loop on the monitor command until it exits. Is there a best practice or trick that you guys use to know when your zxsuite commands are finished before issuing the next command in the restore sequence?

It appears there are a number of steps or sequence for commands that need to be executed for the full restore from the various documentation I have found on this and I was hoping to find an unattended method that I could program into my script. For example it might be nice if there was a FIFO or unix domain socket, etc  I could have my script block on with a read for some sort of finished notification message, etc which you could do with a single write message to that FIFO or unix domain socket .... then the script would continue to do the next command in sequence. Just an idea off the top of my head if there was no method available other than parse the log file.

So I am looking for something like this logic for my script:

zxsuite backup ...

read FIFO and wait/block

unblock when zxsuite above my read completes, check for errors and if none continue processing

zxsuite backup ... next command, etc... repeat.

...

...

until the site is completely restored unattended. 

Do you have any recommendations that I could use to know when a zxsuite command had finished to build my unattended restore script?

Finally, the last question... Is there a way to add files or directories we want to see backed up to that list of files you are saving with the customizations tar image? For example, /opt/zimbra/.acme.sh/

Thanks

Jim

12/24/2021

Hello Jim, I'll try to reply to your questions: >was wondering if there was a best practice or switch to change the priority of what is restored? The restoration order depends by the zimbraId of the accounts to be restored. To achieve your goal, I would suggest using lists of email addresses, one per line, divided by priority. You can prepare some files and then process them sequentially. For example, `/folder/high_priority.txt` and `/folder/medium_priority.txt`. Then you can simply run: * `zxsuite backup doExternalRestore /path/to/restore/folder input_file /folder/high_priority.txt` * `zxsuite backup doExternalRestore /path/to/restore/folder input_file /folder/medium_priority.txt` * `zxsuite backup doExternalRestore /path/to/restore/folder` The last command will restore all the remaining accounts, skipping the ones already imported. >Is there a best practice or trick that you guys use to know when your zxsuite commands are finished before issuing the next command in the restore sequence? ZxSuite commands are asynchronous, this means that when you run the command it will be immediately terminated and the operation will continue running in the background. To force the command waiting the end of the operation, you can use the `--sync` parameter as the following example: `zxsuite --sync backup doExternalRestore ...` This will make the command wait for the operation to terminate and will return an exit code (Successful, Failed, Stopped, Removed, Interrupted). Another useful parameter for the `zxsuite` command is `--json`, which will return the output in JSON format, this could be useful in your scripts. >Is there a way to add files or directories we want to see backed up to that list of files you are saving with the customizations tar image? Could you please give me more details on this? If the software doesn't already backup your customizations to Zimbra, maybe I can open an RFE to the Product Owners, but I'll need more details on the case use and the kind of data you're going to add. Hope this helps. Thanks in advance.

Post your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Zextras Suite 3.1.10 | Blog
How to Upgrade Zextras Theme for Zimbra | Zimbra