Migrate Zimbra 8.x from CentOS 6 to CentOS 8

Even if Zimbra 9 is released, I keep my production in version 8 in order not to suffer from bugs inherent to major versions release.

But until recently, I hadn’t been able to change OS version because Zimbra didn’t support CentOS 8 (released on 07/05/2019), and it’s now supported since patch 11 (released on 02/07/2020). We had to wait a little less than a year before being able to update…

From there, I was able to build a new VM and apply the “old school” migration methodology by rsync. It allowed me to see that I’ve been dragging this Zimbra platform for quite a while because the zmstat folder contains statistics going back to 16/01/2012 (Zimbra 8 was about to be released).

As there’s a big gap between versions, I had to adapt the procedure

  1. Update of the CentOS 6 server and Zimbra in its last available patch

yum -y update

Once this is done and the machine is restarted, we can start the process of copying the files.

2. The Zimbra service is stopped to avoid any writing.

su - zimbra
zmcontrol stop

3. then as root we start copying

rsync -e ssh -axvzKHS /opt/zimbra/ $NEW_ZIMBRA_IP:/tmp/zimbra

4. In the meantime, you can launch on the new server the installation of only Zimbra packages. This is a classical installation, so I won’t go into detail about it. You have to be careful to select the same packages installed on the source server and have the same name as the original server.

./install.sh -s
...

5. Once the installation is finished, you can move (not delete, this is important for the future) the installation folder and replace it with the copy of the source server. Just to make sure you have the right permissions on the freshly copied files, you reapply the right permissions.

mv /opt/zimbra /opt/zimbra_clean
mv /tmp/zimbra /opt/
/opt/zimbra/libexec/zmfixperms --verbose --extended

6. In the procedure, you have to restart the installation but it won’t go as planned because Zimbra tries to run perl scripts for a version 6 of CentOS. So you have to overwrite the existing folder with the initial installation folder :

mv /opt/zimbra/common/lib/perl5/ /opt/zimbra/common/lib/perl5_bak
mv /opt/zimbra_clean/common/lib/perl5 /opt/zimbra/common/lib/

And now we can resume the installation procedure and start our Zimbra on a clean CentOS 8. Enjoy.

PS: If you are using ZeXtras, which I am, you have to reinstall it.

Leave a Reply

Your email address will not be published. Required fields are marked *