=Overview=

I wrote this document because I saw many people having problems with upgrading across OS versions. Using the following procedure, I was able to get around the "Perl_Tstack_sp_ptr" error caused by a newer version of perl. This is a 64 bit to 64 bit migration. I cant speak for a 32bit to 64 bit migration.

Additional goals were:
* Establish a way to upgrade the hardware (new cpu, larger hard drives, etc)
* Have a way to recover back to the starting point without having to go into full disaster recovery mode. If I upgrade in place, and the upgrade goes bad, I am faced with restoring from backup. With the following procedure, the "old" machine is not destroyed - it is just turned off. If the upgrade goes bad, I turn off the "new" machine and turn back on the "old" machine and I am immedately back to where I was before I started.

I tested this procedure multiple times by building two test machines and doing the following process multiple times while correcting the instructions each time until I could complete the process with no loss of data or any errors. Any feedback would be apriciated.

The total time to complete this on my production server was 3 1/2 hours (excluding the time to install Centos 6 on the new machine), however 2 1/2 hours of that was copying 44 gig of data from the old server to the new server. The long time for copying the files was due to (a) I dont have the most screaming latest processor/drives/etc and (b) I was upgrading from one virtual machine to another virtual machine - both of which were on the same box.

Although I only did this w/ the open source version, I would expect this to work just as well with the network edition. The following is from my own experience. I canot speak for any other Linux versions or even gaurantee it will work for you. YMMV.


=First Install Centos 6.2 on new machine=
==Installation Requirements==
* Assign this machine a new ip address - not the same ip address as the old server - but it must be routable so the new server can rsync to the old server. We will change the ip address later.
* during the Centos install - select the "Server" option
* name the new server the SAME as the old server! If the old server is named "mail.mydomain.com" you MUST name the new server "mail.mydomain.com" ANY change to this and the upgrade WONT WORK
==Post install actions==
* Edit /etc/sysconfig/selinux and change SELINUX=enforcing to be SELINUX=disabled
* Edit /etc/hosts and put a line in that reads ip.address.new.server fqdn.ofold.server
* execute the following:

yum -y install openssh-clients nc vim-enhanced sysstat telnet logwatch bind-utils gmp libstdc++.so.6
chkconfig postfix off
service postfix stop
yum -y update

* execute visudo - find the line "Defaults requiretty" and remark it out (put a # at the start of the line)
* configure ip tables to accept inbound ssh connections - and nothing else.
* reboot

=Install OLD version of Zimbra Open Source Edition on new server=

Get the EXACT same version you have on the old server (hopefully you saved the original tar file) and copy it on to the new server. Yes the old version is for Centos 5 and we are putting this on Centos 6 - but we wont be running it - just installing it.

* get the uid and gid for zimbra on the old server.
* create a group zimbra on the new server with the same gid as on the old server. Create a user zimbra with the same uid as on the old server. There are ways to get around not using the same uid and gid, however the work requred to get around if far more work than just creating a user with the correct uid/gid
* Start the install with the command "./install.sh -s --platform-override" Do NOT leave off the -s !
* Install the exact same modules as you have on the old server. Dont be trying to add or remove features at this time! If you dont remember the modules you have on the old server - go to the old server and execute "rpm -qa | grep zimbra" Make note if the following show up in your list:

zimbra-ldap-7.1.1_GA_3196.RHEL5_64-20110527011124
zimbra-logger-7.1.1_GA_3196.RHEL5_64-20110527011124
zimbra-mta-7.1.1_GA_3196.RHEL5_64-20110527011124
zimbra-snmp-7.1.1_GA_3196.RHEL5_64-20110527011124
zimbra-store-7.1.1_GA_3196.RHEL5_64-20110527011124
zimbra-apache-7.1.1_GA_3196.RHEL5_64-20110527011124
zimbra-spell-7.1.1_GA_3196.RHEL5_64-20110527011124
zimbra-memcached-7.1.1_GA_3196.RHEL5_64-20110527011124
zimbra-proxy-7.1.1_GA_3196.RHEL5_64-20110527011124

** My list may be longer than yours as I have all modules installed. There will be some other RPMS listed in your list that are not above, but they will be installed automatically

==Copy the data from the old server to the new server==
The following may seem weird, but it works!
* on the old server, stop the zimbra server and fix it so it will not restart. Execute:
su -
service zimbra stop
chkconfig zimbra off
* On the new server
su -
rm -rf /opt/zimbra
rsync -aP old.server.ip.address:/opt/zimbra /opt
* Do NOT start zimbra on the new server
* Turn off the old server
* change the ip address on the new server to be the same as the old server. Confirm that the ip address change is working correctly via ssh (either ssh to the server and confirm you are on the new server or ssh from the new server to some other system where it will confirm what your ip address is)
=Upgrade new server to 7.1.3=
Yes - you read that correctly. I could not upgrade my server directly from 7.1.1 to 7.2. When I attempted to do so, the upgrade failed. So after much wailing and gnashing of teeth, I discovered if I upgraded first to 7.1.3, I then could upgrade to 7.2
* from the zcs-7.1.3_GA_3346.RHEL6_64.20110928134428 directory execute:
su -
./install.sh --platform-override
* When prompted "Do you want to verify message store database integrity? [Y]" answer NO <--THIS IS IMPORTANT!!! If you answer yes your upgrade will fail.
* When prompted "Do you wish to upgrade? [Y]" answer yes
* if there are no errors during the install, procede to upgrade to version 7.2
=Upgrade to version 7.2=
* untar the 7.2 version and start the install using the command "./install.sh --platform-overide"
* This time, when prompted "Do you want to verify message store database integrity? [Y]" answer yes
* If you get the following message, and the errors are only "You can't use locks with log tables" dont worry. This is a "feature" of mysql.

Database errors found.
/opt/zimbra/mysql/bin/mysqlcheck --defaults-file=/opt/zimbra/conf/my.cnf -S /opt/zimbra/db/mysql.sock -A -C -s -u root --auto-repair --password=XXXXXXXX
mysql.general_log
Error : You can't use locks with log tables.
mysql.slow_log
Error : You can't use locks with log tables.

* When prompted "Do you wish to upgrade? [Y]" answer yes
* When it is complete, review the logs (especially the /var/log/zimbra.log file for errors)
* using telnet, connect via port 110 to simulate a pop3 connection (see http://wiki.linuxquestions.org/wiki/...y_using_telnet) Use the list command to dermine the number of emails in the mailbox
* using telnet send an email to the above pop3 account (see How to Send Email Using Telnet: 12 steps - wikiHow)
* use telnet again to connect to pop3 on the same account. The number of emails in the mailbox should have increased.
* After you are satisified that everything is working, open up the needed ports in iptables. (If need be, refer to the iptables settings on the old server)
* Congradulations, you have upgraded to 7.2 on Centos 6!