Migrating and Moving Zimbra 8.0.9 to Zimbra 8.6 on a new server

      Comments Off on Migrating and Moving Zimbra 8.0.9 to Zimbra 8.6 on a new server

Moving Zimbra 8.0.9 to Zimbra 8.6 on a New Server

Disclaimer: I have the NETWORK version but chose not to use the backup/restore method available with the commercial version. This method (rsync variation) should work with both the free and commercial.  We use tar to handle the sparse 80GB ldap file.  This can run hot without the need to stop zimbra. The plan is to run rsync often and just before final cut-over would you do your shutdown as an extra precaution before doing that last rsync. Generally, that rsync will take just a min or so as a result and reduce your downtime for the production server. We also use this method to rehearse zimbra upgrades and patch releases before trying them on our production servers.

Summary of Steps

  • On existing host, Backup existing zimbra instance via rsync
  • On new host, install zimbra software (install.sh -s)
  • On existing production host, push zimbra files and data via rsync
  • On new host, update new ip address
  • Optional: Can try upgrade of new zimbra releases

Detailed Steps

Modify /etc/hosts on new host so that the name of your old server is represented in this new server. Run split brain DNS and set the resolv.conf to install operating specific software required for a normal zimbra installation. Finally set the hostname to be exactly the same. On the production zimbra host, add a firewall rule to prevent this new host from access. This prevents problems should you fail to create the /etc/hosts entries and the new server tries to connect to its ldap server (ie. the production server).  This requires that both the OS and zimbra are the same. Prior to running these procedures, verify this information.

Step 1: On new server, install software only.

# install.sh -s --skip-activation-check

Step 2:  On existing zimbra server, rsync zimbra  files and data.  Zimbra instance was approx 80GB that this was tested against. Once the initial data is copied, subsequent rsync updates take a few minutes or less to keep everything in sync.


# 80GB sparse file so we handle differently
cd /opt/zimbra/data/ldap/mdb/db
tar cvzSpf data.mdb.tar.gz data.mdb

# backup /opt/zimbra including this sparse ldap tar file just created but ignore the actual sparse file
rsync --progress --delete --archive --verbose --hard-links --exclude=zimbra/dat
a/ldap/mdb/db/data\.mdb --exclude=zimbra/backup /opt/zimbra New-Server:/opt/

Step 3: On new server, Extract ldap. Generally, you don’t have to run zmfixperms after extracting the ldap database but I list it here if install.sh in the next step fails to run.


# Assumes: ldap has tar image of sparse file from previous step.
echo 'Unpacking ldap stuff'
cd /opt/zimbra/data/ldap/mdb/db
/bin/rm -f data.mdb
tar xvzSpf data.mdb.tar.gz
chown zimbra:zimbra data.mdb

echo 'fixing permissions'
cd /opt/zimbra
/opt/zimbra/libexec/zmfixperms -extended
chown -R zimbra:zimbra /opt/zimbra/.ssh

At this point, you have a broken zimbra instance but the next step will repair it.

Step 4: On new server, allow zimbra update to fix/repair permission, etc.

#cd zcs-NETWORK-8.0.9_GA_6191.RHEL6_64.20141103151719

# ./install.sh --skip-activation-check

Almost there… fix the ip addresses. Replace X.X.X.X with new server

% zmprov -l ms `zmhostname` zimbraMtaMyNetworks ' X.X.X.X/32'

% postfix reload

# vi /opt/zimbra/conf/opendkim-localnets.conf
# vi /opt/zimbra/conf/amavisd.conf
# vi /opt/zimbra/conf/salocal.cf

You can repeat this as often as required and test the server prior.  The next step will prevent you from rolling back so if that happens, one must do an ./install -u first if you upgrade your Zimbra installation to a new or different version.

Install the upgraded version of Zimbra. Once you upgrade, you can’t roll back the version of zimbra to a previous release without repeating all these steps.

 # cd zcs-NETWORK-8.6.0_GA_1153.RHEL6_64.20141215151258 # ./install.sh 

Update 10/25/2016:

When moving a 8.6 site with this method, zimbra will attempt to install their DNS caching server. That means the install will bring up the config menu because you have a port conflict on port 53 since are running split brain DNS on this new server. Choose option 5 and then option 1 for status and disable that when prompted.

If moving to Zimbra 8.7, they require that you having proxying enabled for everything. See readme note: enabling proxy for the commands.

I have a general discussion here with more detail of new servers installs: