Zimbra Disaster Recovery

Posted by Tejus Parikh on November 22, 2009

I had queued up a post about the improvements/deprovements in Zimbra 6. Except a comedy of errors led the power supply my mail server to die before I had the chance. This is the second hardware failure this year, so we decided to move our mail and calendars to Google Apps.

That was the easy part, the not so easy part was moving the 4+ years of email sitting on the dead servers hard drive. Most of the process is general recovery hacking: pull out the hard drive, put it in a new machine, do a backup. Restoring onto a new server is where it got a complicated.

I used VirtualBox to host my Centos 4.8 vm with a Mac OSX guest. This Guide on the Zimbra wiki is the correct procedure to recover from this situation. Its very accurate, but it’s worth mentioning a few important highlights.

First, make sure you’re setups are identical. I had forgotten to install a few of the services on my restore machine which caused all sorts of problems and startup failures.

Also, for reasons that I have yet to determine, Zimbra is incredibly crash prone when running in a virtualized environment. You may have to restart often. When trying to test this process, I encountered multiple segmentation faults in Zimbra’s services.

Since this means that you’ll restart often, it’s best to shut off all extraneous services. [caption id=”attachment_464” align=”aligncenter” width=”172” caption=”You only need these”]You only need these[/caption]

Changing these setting will allow for quicker reboots, shutdowns, and reduce the number of things that can go wrong. I also disabled SSL on my zimbra instance, to future reduce the number of problems.

Now you’re ready to move your email. The best approach is to use imapsync. This utility, written in perl, is like rsync for your mail. It will only move mail that does not exist in the remote location. It can also be restarted after a crash to continue on after a crash (see a few paragraphs above). You’ll probably have to baby-sit the process for a bit, but within a few hours, you should be off your self-hosted email solution and into the manged services of Gmail.

Related Posts:

Tejus Parikh

Tejus is an software developer, now working at large companies. Find out when I write new posts on twitter, via RSS or subscribe to the newsletter: