ZCS to ZCS rsync Migration: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{ZC}}{{Article Infobox|{{admin}}|{{ZCS 8.0}} | {{ZC}}{{Article Infobox|{{admin}}|{{ZCS 8.0}} {{ZCS 7.0}} {{ZCS 6.0}} {{ZCS 5.0}} {{ZCS 4.5}}|}} | ||
= ZCS to ZCS rsync Migration = | = ZCS to ZCS rsync Migration = |
Revision as of 19:28, 3 May 2014
Article Information |
---|
This article applies to the following ZCS versions.
ZCS 7.0 ZCS 6.0 ZCS 5.0 ZCS 4.5 {{{4}}}|}
ZCS to ZCS rsync MigrationUsing rsync to migrate from an old ZCS mailstore to a new ZCS mailstore can be required for multiple reasons:
For the purposes of this documentation, we will call the two platforms the "Old Server" and the "New Server". RequirementsIMPORTANT: The ZCS release you install on the New Server must be the same ZCS Version as installed on the Old Server. The server can have a different operating system, but the ZCS Version must be identical. The new server hardware must meet the requirements described in the Installation Prerequisites section of the ZCS Single Server Installation Guide. Install the new operating systems, making any necessary OS configuration modifications as described in the installation guide. Please note too: this method is not required for ancillary systems, such as LDAP nodes, MTAs, or Proxies - all of these nodes can have new systems added while the old system is still running, and therefore do not require the rsync methods described here. Use Rolling Upgrade methods for non-mailstores systems. This rsync method is specifically for ZCS mailstores. Migration StepsFor the migration, you would perform the following high-level steps to minimize downtime: New Server:
Old Server:
You do the following on the New Server:
Preparing the Old Server1. Block client access to the server's IP address with firewall rules. 2. Create a backup directory on each of the Old Server and New Server, for use in copying data. As root, type the following: On Old Server: mkdir /backup On New Server: mkdir /backup 3. On both servers, as user root, type: chown zimbra:zimbra /backup 4. Stop the Old Server, type su - zimbra zmcontrol stop 5. On ZCS 6.0 and later, backup the LDAP config database, as user zimbra, type /opt/zimbra/libexec/zmslapcat -c /backup 6/ Backup the LDAP data, as zimbra, type /opt/zimbra/libexec/zmslapcat /backup 7. Change the hostname and IP address on the old server to something else. Do not turn off the server. Preparing the New ServerInstall ZCS
ZCS is installed. To continueStop the ZCS services, type su - zimbra zmcontrol stop ZCS 5.0.x LDAP ImportRestore the LDAP data to the New Server. As zimbra, type 1. First, move aside the default LDAP data on the New Server, as user zimbra: su - zimbra mkdir /var/tmp/old mv -f /opt/zimbra/openldap-data/* /var/tmp/old 2. Copy the file: /opt/zimbra/openldap-data/DB_CONFIG from the Old Server to the New Server: /opt/zimbra/openldap-data/DB_CONFIG Note: If this file does not exist, or is empty, creating it may improve ldap performance; see the Performance Tuning Guide for more information. 3. Create the necessary directory structure. Type the following as user root: mkdir -p /opt/zimbra/openldap-data/logs /opt/zimbra/openldap-data/accesslog/db /opt/zimbra/openldap-data/accesslog/logs Set the correct permissions on the directory: chown -R zimbra:zimbra /opt/zimbra/openldap-data 4. Copy from the Old Server to the New Server the file: /backup/ldap.bak 5. Import the LDAP Data: /opt/zimbra/openldap/sbin/slapadd -q -b "" -f /opt/zimbra/conf/slapd.conf -cv -l /backup/ldap.bak ZCS 6.0.x-7.0.x LDAP Import1. Restore the LDAP data to the New Server. As user root: mkdir /var/tmp/old mv -f /opt/zimbra/data/ldap/config/* /var/tmp/old mv -f /opt/zimbra/data/ldap/hdb/* /var/tmp/old 2. If this is an ldap master with replicas: mv -f /opt/zimbra/data/ldap/accesslog/* /var/tmp/old 3. Create new directories: mkdir -p /opt/zimbra/data/ldap/hdb/db /opt/zimbra/data/ldap/hdb/logs 4. If this is an ldap master with replicas: mkdir -p /opt/zimbra/data/ldap/accesslog/db /opt/zimbra/data/ldap/accesslog/logs 5. Copy this file from the Old Server: /opt/zimbra/data/ldap/hdb/db/DB_CONFIG To the New Server: /opt/zimbra/data/ldap/hdb/db/DB_CONFIG Note: If this file does not exist, or is empty, creating it may improve ldap performance; see the Performance Tuning Guide for more information. 6. Set the permissions correctly: chown -R zimbra:zimbra /opt/zimbra/data/ldap 7. Copy the LDAP config data from the Old Server to the New Server: /backup/ldap-config.bak 8. Copy from LDAP data the Old Server server to the New Server: /backup/ldap.bak 9. Import the LDAP config: /opt/zimbra/openldap/sbin/slapadd -q -n 0 -F /opt/zimbra/data/ldap/config -cv -l /backup/ldap-config.bak 10. Import the LDAP data: /opt/zimbra/openldap/sbin/slapadd -q -b "" -F /opt/zimbra/data/ldap/config -cv -l /backup/ldap.bak ZCS 8.0.x-8.5.x LDAP Import1. On the New Server, move aside the default LDAP data: (as root) cd /opt/zimbra/data/ldap mv -f mdb /var/tmp/old 2. On the New Server, create the new directories mkdir -p mdb/db WARNING: ONLY REMOVE AND RELOAD THE CONFIG DB IF ABSOLUTELY NECESSARY. Reloading the config db should rarely be necessary (unless you customized the config). To do so though and only if necessary, you would need to clear the config/ directory and import the config data: cd /opt/zimbra/data/ldap mv -f config /var/tmp/old mkdir config ZCS 8: Reloading the accesslog DB would only apply to a master or multi-master scenario. If necessary: cd /opt/zimbra/data/ldap mv acccesslog /var/tmp/old mkdir -p accesslog/db 3. Set the permissions correctly: chown -R zimbra:zimbra /opt/zimbra/data/ldap 4. Export the data from the Old Server: (as user zimbra) Example of main database export: /opt/zimbra/libexec/zmslapcat /backup Example of configuration database export: /opt/zimbra/libexec/zmslapcat -c /backup Example of an accesslog database export (8.0.2 and later): /opt/zimbra/libexec/zmslapcat -a /backup 5. Copy the files from /backup/ from the Old Server to the New Server, put them in /backup on the New Server 6. Import the data to the New Server:
As the user zimbra: /opt/zimbra/libexec/zmslapadd -c /backup/ldap-config.bak
/opt/zimbra/libexec/zmslapadd /backup/ldap.bak
/opt/zimbra/libexec/zmslapadd -a /backup/ldap-accesslog.bak Set the Passwords from the Old ServerFor all versions:
Import the MySQL DataDelete the MySQL data on the New Server and copy the MySQL data from the Old Server. 1. On the New Server, move the default database aside: mv -f /opt/zimbra/db/data/* /var/tmp/old 2. Copy the MySQL data to the New Server: (on Old Server) rsync --delete -axvzKHS /opt/zimbra/db/data/* newserver:/opt/zimbra/db/data/ Note: if you are having any problems moving over the MySQL data as raw data files, you can instead export the data from the Old Server and import it to the New Server, as described here: http://wiki.zimbra.com/wiki/MySQL_Backup_and_Restore Copy the Message Blob DataCopy the following files from the Old Server to the New Server 1. On New Server, move aside default files: mv -f /opt/zimbra/store/* /var/tmp/old mv -f /opt/zimbra/index/* /var/tmp/old 2. Rsync all files to the new server: (on Old Server) rsync --delete -axvzKHS /opt/zimbra/store/* newserver:/opt/zimbra/store/ rsync --delete -axvzKHS /opt/zimbra/index/* newserver:/opt/zimbra/index/ 3. Be sure to rsync over any other message volumes needed, such as if using HSM or secondary volumes: (on Old Server) rsync --delete -axvzKHS /opt/zimbra/hsm/* newserver:/opt/zimbra/hsm/ Copy Commercial SSL Certificates (if used)
Clear Old Backups from the New Server
mv f /opt/zimbra/redolog/* /var/tmp/old Fix the Permissions
(as root) /opt/zimbra/libexec/zmfixperms Start the Services on the New Server1. Start ZCS (as user zimbra) zmcontrol start 2. Now run a full backup zmbackup -f -a all 3. Remove the firewall rules and allow client access to the new server. Reference Documentation
Keywords: Migration, migrating, 32bit, 64bit, architecture, moving
|