32 bit to 64 bit Zimbra Server Migration on Ubuntu

Posted December 14th, 2012 by bryanr

I recently succeeded in migrating our Zimbra server to a 64bit operating system.  If you are tasked with doing the same, I hope this post helps you out, because a ran into a few problems.  I had to use 4 different guides to finish the migration on Ubuntu; apparently the migration on Ubuntu requires more steps than other operating systems.  If you are reading this you already know that Zimbra no longer supports a 32bit operating system for it's newest release, Zimbra 8.  In our environment, we moved from Zimbra 7.2.1 on Ubuntu 8.04 32bit to Zimbra 7.2.1 on Ubuntu 10.04 64bit.

Here are the guides that I used to complete the move:

http://wiki.zimbra.com/wiki/Platform_and_OS_Independent_ZCS_to_ZCS_Migration_Using_Rsync

http://wiki.zimbra.com/wiki/Ajcody-Notes-Server-Move

http://wiki.zimbra.com/wiki/Network_Edition:_Moving_from_32-bit_to_64-bit_Server

http://wiki.zimbra.com/wiki/LDAP_data_import_export

http://stefaanlippens.net/32bit_executable_on_64bit_machine

For the most part, I followed the first guide above, which is pretty straight foward.  But it omits several steps that were required in our migration.  Here is what I did:

Make certain you are installing the exact version of Zimbra on the new server that was installed on your old server!

Install 32bit runtime libraries on Ubuntu as root.

apt-get install ia32-libs

Install the just the packages on new host.

./install.sh -s

Copy /opt/zimbra/zimbramon of the 64bit installed stuff to a tmp dir

cp -rp /opt/zimbra/zimbramon /opt/zimbramon-64bit

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

Continue to sync the zimbra directory until you are ready to move.

 

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

Copy the zimbramon-tmp over the /opt/zimbra/zimbramon dir

cp -rp /opt/zimbramon-64bit/* /opt/zimbra/zimbramon 

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. Backup LDAP config data, type:

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

e. On new host, do:

mkdir /backup

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

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

g. From old host, copy over the ldap-config.bak file:

scp /backup/ldap-config.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/*
rm -rf /opt/zimbra/data/ldap/config/*

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

Create the new directory structure and restore database tuning

cd /opt/zimbra/data/ldap
mkdir -p hdb/db
mkdir -p hdb/logs

Type:

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

Type:

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

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. 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 as you will receive some errors.

update the ssh keys after the install is finished, as zimbra, type:

zmsshkeygen

zmupdateauthkeys

zmcontrol restart

Make sure that the UID for the zimbra user is the same as before. If it has changed, edit /etc/passwd to make it match the zimbra user UID on the old server.

If you use secondary disks, you can mount them on your new operating system without any problems.  The filesystem is not changed from 32bit to 64bit.

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.

 

One Response to “32 bit to 64 bit Zimbra Server Migration on Ubuntu”

  1. david

    nice article, i'm about to put it to test!  can you tell me though, i'm a little confused about /opt/zimbra/zimbramon? first you say (on new server), rm -rf /opt/zimbra, then you copy /opt/zimbra/zimbramon off? how can that be if you just removed it!?

    thanks!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>