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

No edit summary
No edit summary
Line 63: Line 63:
  mkdir /backup
  mkdir /backup
b. As root, type:  
b. As root, type:  
  chown zimbra:zimbra /backup.
  chown zimbra:zimbra /backup
c. Backup the LDAP data, as zimbra, type:
c. Backup the LDAP data, as zimbra, type:
  /opt/zimbra/libexec/zmslapcat /backup
  /opt/zimbra/libexec/zmslapcat /backup
d. On new host, do:
d. On new host, do:
  mkdir /backup.
  mkdir /backup
e. From old host, copy over the ldap.bak file:
e. From old host, copy over the ldap.bak file:
  scp /backup/ldap.bak root@newserver.com:/backup  
  scp /backup/ldap.bak root@newserver.com:/backup  

Revision as of 21:22, 2 June 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.

Broadly:

rsync /opt/zimbra from old host to target host

Import LDAP data


To Outline:

Install the exact same version of ZCS on the new server using the -s flag.

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 -avzH -e ssh --progress /opt/zimbra/ root@NEWHOSTIP:/opt/zimbra


Move Day-

Stop services on old 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

Type:

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

Type:

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

Run install.sh this time without the -s flag. Select Y to upgrade.

Now your /opt/zimbra/* is the same on both hosts, 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 Documents migration:

[[1]]

Jump to: navigation, search