October 4, 2012 by aubreykloppers
Earlier I wrote on the steps needed to create a successful migration of Zimbra from Centos5 to Centos6. I am doing this on a SPLIT-DNS environment and will end up having 2 Zimbra Server. So-far my steps are as follows:
(I am using ESXi 4.1, but ESXi 5 would also do)
Preparing the system:
- Create a new VM called Zimbra8 with initial disk space of 25G.
- Install CentOS 6.4
- Boot system and add proxy info to /etc/yum.conf (Add to last line “proxy=http://<IP>:<PORT>”
- Install: “yum -y install bind bind-utils nc”
- Download and install webmin: “yum install webmin(release).rpm” and start webmin server.
- Disable POSTFIX and FIREWALL. (This can be done in WEBMIN)
- Fix network and named configurations. (Copied from old Server, just change the INTERNAL IP NUMBERS.)
- Generate rndc key: “rndc-confgen -a”.
Using the Webmin YUM repository
If you like to install and update Webmin via RPM, create the /etc/yum.repos.d/webmin.repo file containing :
[Webmin]You should also fetch and install my GPG key with which the packages are signed, with the commands :
name=Webmin Distribution Neutral
wget http://www.webmin.com/jcameron-key.ascYou will now be able to install with the command :
rpm --import jcameron-key.asc
yum install webminAll dependencies should be resolved automatically.
At this stage everything was running 100% and DIG working as it should. I then:
- Took down the server and created an OVA template from the server. (1.7G in size.)
- Added a new virtual-disk (700G) to the system.
- Boot the system and added the additional disk: “fdisk /dev/sdb” (After finding the disk with “ls /dev/sd*”) and doing a n/p/1/w. (See my post https://aubreykloppers.wordpress.com/2012/07/01/openmediavault-initialize-3tb-disks/)
- Created a new ext4 file system with: “mkfs.ext4 -L store /dev/sdb1”
- Mounted the disk on /opt/zimbra. (Using “webmin/system/disk and network filesystems” and creating a mount-point)
OK, this got me to a stage where I am ready to do a fresh install of Zimbra for migration purposes.
NOTE: From this stage onward, no SNAPSHOTS or OVF files will be created. This is due to the fact that (1)The system now has a 700G disk attached and (2)The moving of the old system will take HUGE amounts of disk-space.
NOTE: I am using Zimbra 7.1.3 on both servers.
- Extract zimbra archive with: “tar -zxvf zcs<release you downloaded>.tgz”
- cd to the extracted directory.
- Run: “./install –platform-override –skip-activation-check”
- NOTE: At this stage I was missing out on libstdc++.so.6 and ran: “ln -s /usr/lib64/libstdc++.so.6.0.13 /usr/lib/libstdc++.so.6” to rectify it. Reran POINT 4.
- Got a warning that /opt/zimbra exists and ignored it. (Not to delete it…)
- Answered all the questions and the installation started ok.
- Entered my domain-name and the post-installation-tasks came up.
- Changed password (make it password initially to not having to hassle later on, you can always change it in the console) and applied my license.
NOTE: Regarding your Domain Name. If you configured your mail server as mail.domain.com, your domain is domain.com. NOT mail.domain.com!
At this stage the system came up as it should.
- Signed on as admin/password and changed my password to a secure one: “https://<IP>:7071”.
- The system showed everything as down, although running: “zmcontrol status” showed everything up-and-running. I believe this is due to the license not being verified, but I will leave this for last. (In case I need to re-load the system from scratch.)
- One of the things I forgot to do was change the access rights on /opt/zimbra and did so by: “chown zimbra zimbra” and “chgrp zimbra zimbra” in the /opt directory. Failing to do so leaves a whole lot of missing items on the interface.
- I then stopped the zimbra services with: “zmcontrol stop” and created a directory with “mkdir /opt/old.zimbra”
- I did a rsync (to keep the new installation) with: “rsync -azvp /opt/zimbra/ /opt/old.zimbra/” as I am going to overwrite this with the old zimbra server.
- I then deleted everything in /op/zimbra.
- Rebooted the system.
OK, this left me with a skeleton Zimbra Server with no data of any sorts. The server is now ready to receive data.
Transferring data from the OLD Zimbra Server to the NEW Zimbra Server:
Script used to transfer the data:
[root@mail ~]# more /scripts/backup.sh
rsync -avHK –delete –force /scripts/ root@<destination IP>:/scripts/
rsync -avHK –delete –force /opt/zimbra/ root@<destination IP>:/opt/zimbra/
- The above script will prompt you for a password on every command. This is so that if I forgot something, I get stopped. (I have a directory full of scripts to manage the system that gets copied with the first line.)
- It is also very easy to interrupt with CTRL+C.
- The mailboxes (stored in /opt/zimbra/store) will take a long time (on a big system) to transfer. My OLD server takes about an hour to “building file list …” to complete before starting the transfer. (I have about 380G space in use on my mailboxes.)
I will continue this posting in about 3 days, when the transfer of data completed.
Check if NAMED SERVICE gets started at bootup once the rcync completed. If not, start it (you can do this in WEBMIN).
At this stage I ran into an LDAP error and was able to correct it with:
Dump the old ldap data on the old server
Remove the default ldap data on the new server
rm -rf /opt/zimbra/data/ldap/hdb/*
Create the db and logs folders
mkdir -p /opt/zimbra/data/ldap/hdb/db /opt/zimbra/data/ldap/hdb/logs
Fix the permissions (make zimbra the owner of the ldap data)
chown -R zimbra\: /opt/zimbra/data/ldap
Import the old ldap data into your new ldap server
/opt/zimbra/openldap/sbin/slapadd -q -b “” -F /opt/zimbra/data/ldap/config -cv -l /tmp/ldap.bak
ran: postmap /opt/zimbra/postfix/conf/transport
recreated the self-signed crt:
- Begin by generating a new Certificate Authority (CA).
/opt/zimbra/bin/zmcertmgr createca -new
- Then generate a certificate signed by the CA that expires in 365 days.
/opt/zimbra/bin/zmcertmgr createcrt -new -days 365
- Next deploy the certificate.
/opt/zimbra/bin/zmcertmgr deploycrt self
- Next deploy the CA.
- To finish, verify the certificate was deployed to all the services.
Upgrading from this point on was as easy as following the prompts and waiting for the system to complete…
Recovering system disk:
- /opt/zimbra/libexec/zmfixperms – This will fix all your permissions of your Zimbra system. Remember to run this as ROOT.