###* If that failed to fixed the install configuration screen situation, redo the above but also remove /opt/zimbra/.saveconfig from NEWHOST and copy that directory from OLDPROD.

+

##* If that failed to fixed the install configuration screen situation, redo the above but also remove /opt/zimbra/.saveconfig from NEWHOST and copy that directory from OLDPROD.

# Within the installation script, you might want to choose the option that tells Zimbra to NOT automatically start upon completion of upgrade/install.

# Within the installation script, you might want to choose the option that tells Zimbra to NOT automatically start upon completion of upgrade/install.

Revision as of 21:04, 1 February 2014

- This is certified documentation and is protected for editing by Zimbra Employees & Moderators only.

- This article describes the steps to move a ZCS server to a new physical or virtual server. Technically, this is not 100% supported as it is not a method that the developers or QA teams test against. But because of customer demands and needs, this method is often preferred compared to Network_Edition_Disaster_Recovery.

THIS IS THE ONLY OTHER DOCUMENTED METHOD BESIDES THE Network_Edition_Disaster_Recovery WIKI FOR A ZCS SERVER MOVE PROCESS THAT ZIMBRA WILL SUPPORT AND ACCEPT SUPPORT CASES FOR.

Support cases should reference this wiki page and include a copy of all the steps and output of them as you work through this how-to. Then noting the issue and step in the how-to your stuck at.

Assumptions

Basic Assumptions

1. OS Type & Version

This article makes the assumption your moving to the same OS type & version. For example, your OLDPROD machine is running RHEL4-64bit. So your new machine would be running the same and brought to the same patch level as well.

2. Same HOSTNAME

New server is setup with the same HOSTNAME information as OLDPROD but it will use a different IP until OLDPROD can be shutoff/reconfigured (if needed)

3. Different IP Issues - Either For Testing Or As A Permanent Change

Problems that are caused by different ip's being in use related to zcs variables will usually show up on the NEWHOST where services [usually mailboxd] can't successfully start.

Note about command examples below.

I used `zmhostname` rather than typing out an explicit hostname.

I also included the -l option for the zmprov ms examples since the NEWHOST most likely will only be able to start the ldap service until you have these variables changed.

One example variable to look for:

zmprov gs `zmhostname` zimbraLmtpBindAddress

To modify on NEWHOST - as zimbra

zmprov -l ms `zmhostname` zimbraLmtpBindAddress "XXX.XXX.XXX.XXX"

replace XXX.XXX.XXX.XXX with the ip address on the NEWHOST

Another example variable to look for - this would be an issue if the NEWHOST is on a different subnet than OLDPROD :

Since there are many possible variable that might include a specific ip reference, it would be best to do something like the following on the OLDPROD and review the possible variables you might have set that are using an explicit ip address.

su - zimbra

ip addr

ifconfig -a

[ NOTE THE IP's BEING USED - You'll grep for the first octet below ]

[ For example, my server's eth0 is using 192.168.0.71 ]

zmlocalconfig | grep 192

[192 is based upon my example]

zmprov gacf | grep 192

zmprov gs `zmhostname` | grep 192

4. SAME AMOUNT OF MEMORY

If your moving from 32bit to 32bit and the new system has more than 4GB of memory and the older one didn't you will most likely need to adjust mailboxd_java_heap_memory_percent . This problem will show up as the mailbox stop starting and /opt/zimbra/log/zmmailboxd.out logging errors about JVM memory heap. Try the following:

su - zimbra

zmlocalconfig -e mailboxd_java_heap_memory_percent=25

zmmailboxdctl restart

Important Advise About Testing Or Practicing This How-To

We strongly encourage customers to 'test' this how-to prior to scheduling

your final downtime for the production server to be moved.

If you plan accordingly, you'll only need two downtime windows on the production server to include this testing. These downtime windows will be much shorter using rsync versus other means to do your server move.

To allow for this recommend testing, please adjust the how-to steps below with the following information. Since at some point you'll have to shutdown zimbra on the production server to get your final rsync, you should preserve the rsync'd data on the NEWHOST if you have the available disk space.

Alternation to the rsync targets:

rsync OLDPROD:/opt/zimbra data to NEWHOST:/opt/zimbra-BACKUP rather than NEWHOST:/opt/zimbra .

Leaving the NEWHOST:/opt/zimbra-BACKUP intact for later reuse for testing and etc..

For retesting purposes, you have two possible methods.

First - jut rsync over the NEWHOST:/opt/zimbra directory

You would use the rsync command that includes the --delete option, since we want NEWHOST:/opt/zimbra to be exactly the same as NEWHOST:/opt/zimbra-BACKUP .

Second - remove NEWHOST:/opt/zimbra and then rsync NEWHOST:/opt/zimbra-BACKUP [copying anything over again into a new and empty NEWHOST:/opt/zimbra ]

run the uninstall option via the zimbra installation script - install.sh -u - on the NEWHOST.

[NEWHOST] rm -rf /opt/zimbra . We want to confirm all files are gone.

Remove any 'zimbra' files in /tmp

And now restart the how-to with a clean zcs installation followed by another rsync of NEWHOST:/opt/zimbra-BACKUP to NEWHOST:/opt/zimbra .

Note - I just used /opt/zimbra above, you'll need to include other data/zmvolume paths as well if you have them.

Final word of advise, please consider installing bind or some other DNS service on your NEWHOST so you can handle resolution locally on that server to resolve to the different ip address the NEWHOST is using. Consult Ajcody-Hostname-DNS and Split_DNS for more details.

The Actual Steps

Preparing NEWHOST Server

Please Note - DO NOT USE CRON WHEN SYNCING YOUR SERVER!

You should always run the rsync command manually. If you fail to do so, and then complete the migration without removing the cron job that did the sync's, and you leave the old server running, you will lose data. The sync will then kick off again when cron runs and overwrite your production data! This will very likely corrupt your installation and leave you with an unstable system!

Install OS

Install on the NEWHOST a supported operating system for the current ZCS version running on the OLDPROD

Configure Zimbra UID and GID

On NEWHOST configure the /etc/passwd to be the same UID for zimbra as the OLDPROD had.

On NEWHOST configure the entry for zimbra in the OLDPROD's /etc/group to match for zimbra as well.

Initial ZCS Install On NEWHOST

Initial ZCS install on NEWHOST

On NEWHOST as ROOT , run the installer with the -s option:

./install.sh -s

This tells the installer to only install the software, and not to configure the installation.

To see what is installed and enabled on the PROD server, do the following on the PROD server as ZIMBRA:

zmprov gs `zmhostname` | grep zimbraService

Save this list, you'll need it also when you rerun the installer later on the NEWHOST to confirm the "upgrade" does the right package upgrades/installs.

Preserving the 64bit zimbramon directory

﻿On NEWHOST as ROOT: Move the zimbramon directory [if it exists] to /opt/zimbramon

mv /opt/zimbra/zimbramon /opt/zimbramon-64

﻿On NEWHOST as ROOT: Remove the dummy install:

rm -rf /opt/zimbra ; mkdir /opt/zimbra

On NEWHOST, make any other mounts or directories you'll need as to match the OLDPROD server.

Secondary mailstores, alternative backup directory paths, etc.

On OLDPROD, double check for these additional mounts by doing:

reviewing /etc/fstab and output of the df command.

run, as ZIMBRA, the following: zmvolume -l and review the output and directory paths.

Sync OLDPROD Data While OLDPROD Is Still In Production Use

Please Note - DO NOT USE CRON WHEN SYNCING YOUR SERVER!

You should always run the rsync command manually. If you fail to do so, and then complete the migration without removing the cron job that did the sync's, and you leave the old server running, you will lose data. The sync will then kick off again when cron runs and overwrite your production data! This will very likely corrupt your installation and leave you with an unstable system!

Preliminary Comments About RSYNC

Rsync options used below.

I've added the -H option to the rsync command to preserve hard links.

-H, --hard-links , preserves hard links

-a, --archive . This is equivalent to -rlptgoD .

From man page:

It is a quick way of saying you want recursion and want to preserve almost everything (with -H being a notable omission). The only exception to the above equivalence is when --files-from is specified, in which case -r is not implied. Note that -a does not preserve hardlinks, because finding multiply-linked files is expensive. You must separately specify -H.

-z, --compress

From man page:

With this option, rsync compresses the file data as it is sent to the destination machine, which reduces the amount of data being transmitted -- something that is useful over a slow connection.

You should upgrade rsync on both servers to version 3+. It addresses some performance issues. Please see the following for more details.

One could also use a more aggressive nice value to start a job after hours but then include a renice command via cron prior to your normal business hours the next day. You would need to script this out though since it would need the process # of the command you wanted to renice.

The Big Day - OLDPROD Downtime For Switch

Block Client Access To OLDPROD's IP Address With Firewall - IPTables

If your remote, make sure to keep your access port open. We are just trying to prevent any changes to the machines while they are being reconfigured.

Do Backup of LDAP DATA on OLDPROD

Note - this wiki page only applies to ZCS 6 and later

Create an LDAP dump directory. As root, type

mkdir /opt/ldap-backup ; chown zimbra:zimbra /opt/ldap-backup

Stop ZCS on OLDPROD, as zimbra type

su - zimbra ; zmcontrol stop

Backup the LDAP config database, as zimbra, type

/opt/zimbra/libexec/zmslapcat -c /opt/ldap-backup

Backup the LDAP data, as zimbra, type

/opt/zimbra/libexec/zmslapcat /opt/ldap-backup

Confirm LDAP In Good State

Get LDAP in a good state prior to the final rsync [as recommend by our LDAP developer - 12/1/2012]

For Versions Prior to ZCS8 , use db_recover - see the following reference for your version:

For ZCS8 , db_recover isn't needed. You must include the -S option though for rsync.

Final Rsync of OLDPROD to NEWHOST

Please Note - YOU MUST PERFORM THIS STEP WITH ZIMBRA DOWN!

Please ensure that you have the Zimbra server STOPPED on BOTH OLDPROD and NEWHOST before performing the final rsync. If you're using this method to test your server move, you must schedule downtime to stop the server before performing the final sync. This is required, and failure to do so will result in corruption of your mysql/ldap databases on the test server.

Fix permissions on NEWHOST

Turn off OLDPROD and reconfigure NEWHOST

Reconfigure network interfaces so if someone turns on OLDPROD later, it will not use the ip addresses that will now be used on NEWHOST.

Reconfigure any mounts (san, nfs, iscsi, etc.) so it will not mount anything that should only be mounted on our NEWHOST. Again, in case the machine is powered on accidentally later.

Reconfigure NEWHOST to take over ip addresses of OLDPROD.

Make any firewall or other network changes that are necessary.

Remember about arp tables.

Reconfigure for any mounts that were on OLDPROD that will be needed for NEWHOST.

Special Check For DNS, IP Address, And Hostname Configurations

If you have a Split DNS install or use private LAN addresses on the server with a firewall front-ending the public addresses, you'll want to verify logical hostname resolution and hostname resolution. In some cases, you can move Zimbra to another server with a different hostname but keep the logical hostname the same. The logical hostname is what users know this server as, and it doesn't necessarily have to match the actual hostname. For example, you might have "mail.mydomain.com" as the DNS name for the server, but the hostname is "web11233"

You need to have the server itself resolve the logical hostname, the old hostname and the new hostname as the internal private LAN address.

host `hostname`

host (logical hostname)

nslookup `hostname`

nslookup (logical hostname)

nslookup (old hostname)

nslookup (old hostname)

You want all these to look the same. You can follow instructions at Split_dns. Essentially what that does is have a local copy of bind (named) running that resolves just those names and forwards all other lookups to your normal DNS servers.

Install of Zimbra on NEWHOST

On NEWHOST as ROOT, rerun the installer without the -s option

./install.sh

It will detect ZCS already installed, and ask if you want to upgrade. Select Yes.

You can confirm the package installation/upgrade selection by comparing the output from the OLDPROD host by running this on the OLDPROD host

zmprov gs `zmhostname` | grep zimbraService

Note - If in the configuration screen it looks like it doesn't have your old values, then the localconfig.xml in /opt/zimbra/conf must of been altered. To fix:

Stop/cancel the install - you'll see an option for it from the list of options.

If that failed to fixed the install configuration screen situation, redo the above but also remove /opt/zimbra/.saveconfig from NEWHOST and copy that directory from OLDPROD.

Within the installation script, you might want to choose the option that tells Zimbra to NOT automatically start upon completion of upgrade/install.

Post-Install on NEWHOST

This document assumes you were going to get the same hostname and ip address once the final move was done. In case this isn't true, below are some follow up issues you might want to check. You might of done some of these already.

Do you need to make adjustments for commercial certificates?

Reconfigure any network interface/ip information that you need because of hardware move.

Make necessary adjustments you might need because of hostname changes. ( see ZmSetServerName )

Adjust any firewall settings

If ip address is going to be different, make sure you know the settings you'll need to adjust within Zimbra (if any).

If ip address is going to be the same, remember your network will take awhile to see change as the new MAC address gets updated to other devices arp table.

If you can, you can speed this along with changes on your switches.

Bringing Up Zimbra On NEWHOST For Production Use

Start zimbra once you think everything is ready.

Do some client access tests within your LAN.

If testing looks good, the remove any firewall rules you might of done to block access from outside. Then confirm outside access and functionality.

Remember to check those mobile devices, certificates, and other access software/devices besides just the Zimbra webclient.