Difference between revisions of "Platform and OS Independent ZCS to ZCS Migration Using Rsync"

Line 108: Line 108:
Please see here for information on the Documents migration:
Please see here for information on the migration:

Revision as of 17:47, 9 September 2011

This is a method for ZCS to ZCS migration that preserves all settings and user accounts, and can be done across different OS's and hardware platforms, including 32 bit to 64 bit server migrations. It has been tested by Zimbra staff and customers.

WE STRONGLY ENCOURAGE performing a test run of the process using a virtual machine or non-production server. This would require a small downtime window while the last rsync is performed.


Install Zimbra packages on new host

rsync /opt/zimbra from old host to target host

Import LDAP data

Run Zimbra installer to upgrade files in /opt/zimbra

To Outline:

Install the exact same release of ZCS on the new server using the -s flag. Use the 64 bit version if you are migrating from 32 to 64 bit.

Remove /opt/zimbra on new host.

Rsync /opt/zimbra from the old server to the new server. This can be done several times prior to the move date to save time.

On move date-

Stop services on old server and complete last rsync to the new one.

Repair permissions on the new server.

Make a backup of the LDAP and scp it to the new server.

Rename new server to old host name. Change IP on new host to old IP or change DNS and allow to propagate.

Restore the LDAP from backup.

Re-run install.sh.

Bring new server online.

Some more detail:

Install the just the packages on new host.

./install.sh -s

Remove /opt/zimbra on new host.

rm -rf /opt/zimbra

On old host, rsync /opt/zimbra AS ROOT to the new host.

nice -n +19 rsync --progress -ahvzH -e ssh  /opt/zimbra/ root@NEWHOSTIP:/opt/zimbra

Move Day-

STOP SERVICES ON OLD HOST. Failure to stop services can result in data corruption on the target host.

zmcontrol stop

Perform last rsync as root on old host.

nice -n -20 rsync -avzH -e ssh --delete --progress /opt/zimbra/ root@NEWHOSTIP:/opt/zimbra 

Repair permissions on new host.

/opt/zimbra/libexec/zmfixperms --verbose --extended 

Export the LDAP data on the old host:

a. Create an LDAP dump directory. As root, type:

mkdir /backup

b. As root, type:

chown zimbra:zimbra /backup

c. Backup the LDAP data, as zimbra, type:

/opt/zimbra/libexec/zmslapcat /backup

d. On new host, do:

mkdir /backup

e. From old host, copy over the ldap.bak file:

scp /backup/ldap.bak root@newserver.com:/backup 

Rename new host to old name and change IP. If you are not changing the IP, make sure that you have updated DNS and that the hostname resolves to the correct IP. (This varies by distro- /etc/hosts /etc/sysconfig etc). You may want to reboot the host just to be sure the name change takes.

Restore the LDAP data to the new server. As zimbra, type on new server:

rm -rf /opt/zimbra/data/ldap/hdb/*

If this is an ldap master with replicas:

rm -rf /opt/zimbra/data/ldap/accesslog/*
mkdir -p /opt/zimbra/data/ldap/hdb/db /opt/zimbra/data/ldap/hdb/logs

If this is an ldap master with replicas:

mkdir -p /opt/zimbra/data/ldap/accesslog/db /opt/zimbra/data/accesslog/logs


chown -R zimbra:zimbra /opt/zimbra/data/ldap


/opt/zimbra/openldap/sbin/slapadd -q -b "" -F /opt/zimbra/data/ldap/config -cv -l /backup/ldap.bak



this time without the -s flag. This will upgrade the files under /opt/zimbra that need to be corrected for the new hardware. Select Y to upgrade. Do not check the database.

Some users have reported that they needed to update the ssh keys after starting the new server:



zmcontrol restart

Now your /opt/zimbra/* is the same on both hosts (or upgraded for new hardware by install.sh), and you have imported the LDAP DB, your hostname should be the same as before. You should be able to start Zimbra on the new host.

Please see here for information on the migration:


Jump to: navigation, search