Moving ZCS to Another Server

Posted in PowerTips - Admins by John Holder on the October 9th, 2007

In this Zimbra Administrator’s PowerTip, we’ll discuss how to move your instance of Zimbra to another machine. It applies to all version of Zimbra.




Administrator’s PowerTip
#4: October 09, 2007
Zimbra Forums - Zimbra wiki - Zimbra
Blog

Introduction


Either you, or someone you know has been there. Almost out of Disk space, RAM is topped out, and the CPU is constantly running above 80%. It’s time to upgrade the hardware. But how easy and safe is it to move the Zimbra server instance? Well, it’s easier than you might think.

In this Zimbra Administrator’s PowerTip, we’ll discuss how to migrate your Zimbra server to another Machine or OS. The one big caveat is that both instances of Zimbra MUST be running the same version. So if your old server is running 4.5.5, then you’ll need to install 4.5.5 on your new server. This wouldn’t be the time to upgrade your ZCS version.

Part 1 : Backing Up

Zimbra Network Edition contains a backup feature, and although it’s useful, we won’t be using it in this tip.

We have an external Hard Disc mounted to /mnt/migration. When rsync’ed, this is now your live copy (although it’s not live), and you should always have a backup of your live data. So, you might want to rsync again to another location to be safe.

Once you’ve rsync’ed all your data, umount the external drive, and put it somewhere safe.

Part 2 : Meet Your New Server

The only thing that really matters on your new server, is whether or not meets Zimbra’s server Hardware and the Operating System requirements.

It’s also very important that you have resolved any dependency issues. The ZCS installer for your newer OS should check for these.

Setup the newer server with the old server’s networking attributes. Make sure your older server is offline.

If changing the hostname, please see this wiki article: Set zmhostname


Part 3 : Create a "dummy" Install Then Remove It


The goal of this step is to get the rpm/dpkg databases correct. When you download ZCS, make sure it’s for your newer OS, and the SAME version of ZCS that’s rsync’ed.

Run the installer with the -s option. This tells the installer to only install the software, and not to configure the installation.

Once the installer has completed, delete it by rm -rf /opt/zimbra. This wipes any dummy data you have in that location.



Part 4 : Mount Your Backup HD, rsync, and Install


Connect and mount your external hard drive. Then, rsync the backed up data to its new location (rsync -avr /mnt/migration/zimbra /opt).

Connect and mount your external hard drive. Then, rsync the backed up data to its new location (rsync -avr /mnt/migration/zimbra /opt).
Unmount your backed up copy, and keep it in a safe place.
Now that our data is all in place, we need to fix some permissions. Go into the /opt/zimbra/libexec directory and run zmfixperms. This helps insure that all the files are owned correctly.
Once that has completed, re run the installer that you downloaded. It will detect ZCS already installed, and ask if you want to upgrade. Select Yes.


11 Responses to 'Moving ZCS to Another Server'

Subscribe to comments with RSS or TrackBack to 'Moving ZCS to Another Server'.


  1. on October 10th, 2007 at 8:45 am

    Thanks!

  2. Dean said,

    on October 10th, 2007 at 9:58 pm

    Following this guide my Zimbra install would not start on the new server (Open Source Edition - RHEL5, moved from RHEL4).

    One thing you might want to add to this guide is to make sure the zimbra user on the new server has the same UID/GID as the old server, or to change localconfig.xml to reflect the properties of the zimbra user on the new server.

  3. Scott Dowdle said,

    on October 11th, 2007 at 4:10 pm

    I followed this recipe although I had to alter it a little bit because I’m running Zimbra in an OpenVZ VPS.

    My goal was to migrate from Zimbra for RHEL4 running on a CentOS 4 VPS to Zimbra for RHEL5 running on a CentOS 5 VPS.

    For my new machine I created a new VPS while the original VPS ran. The new VPS had a different hostname and IP while I was working on it. After everything was configured and installed… I stopped both VPSes, switched VPS private dirs, rsyc’ed the /opt/zimbra directory. Since I switched private dirs, I was able to start up the new machine with the hostname and ip of the original. Then I progressed through the rest of the steps in the recipe.

    Total down time was about 10 minutes and most of that was for the rysnc. I could have reduced the down time by doing an initial rsync of /opt/zimbra before taking down the original machine, and then doing a much faster second pass rsync after shutting down both machines. Another good thing is that I had my original machine’s VPS directory still around so if I had screwed up and the data migration had failed, I could have instantly switched back to the original.

    Of course I don’t have zillions of accounts and the total amount of disk space of /opt/zimbra was only 4.3 GB… so that helped too.

  4. Jeffrey Turmelle said,

    on October 17th, 2007 at 7:07 am

    The Intro says this will migrate to a new OS, but that’s simply not possible with this tip. I am trying to migrate from MacOSX to RHEL4.

    Any hints for that?

  5. John Holder said,

    on November 3rd, 2007 at 9:43 pm

    Hi Jeffery,

    You bring up an important point. Mac is kind of an exception I should have mentioned simply because of how it’s packaged.

    The only alteration is that you should dump ldap to file, and re-import it using slapcat.

    More information on that can be found in the PowerTip about ldap.

  6. Justin Clacherty said,

    on November 7th, 2007 at 5:52 am

    Thanks John. I’ve followed these instructions to update from 4.5.9 running on FC4 to 4.5.9 running on CentOS 5 but haven’t been able to get it working. When I do the final run on install.sh I get errors once ldap is started (account.NO_SUCH_SERVER and account.NO_SUCH_COS). Then when it goes to set up the ports, it doesn’t seem to know what ports are being used so wants me to enter that information. It’s as if some of the server configuration isn’t being brought in to LDAP. Any ideas? The source server is running fine. I can post this in the forum if it’s more appropriate.

  7. John Holder said,

    on November 29th, 2007 at 10:16 am

    @Justin,
    Sorry it took so long for me to reply! I must have missed this one.

    Looks like your localconfig.xml got wiped. This can occur on multiple failed restores. Did you try restoring that file from your backup?

  8. Justin Clacherty said,

    on November 30th, 2007 at 4:47 am

    No worries John. I also posted to the forums and have got it going. Check out this link for the fix.

    http://www.zimbra.com/forums/installation/12681-solved-problems-migrating-new-server.html

  9. parixit said,

    on December 1st, 2007 at 4:28 pm

    Hello I seem to be getting the following errors when i run the zmfixperms command

    ./zmfixperms
    : command not found/get_plat_tag.sh: line 26:
    : command not found/get_plat_tag.sh: line 27:
    /opt/zimbra/libexec/get_plat_tag.sh: line 33: syntax error near unexpected token `else’
    ‘opt/zimbra/libexec/get_plat_tag.sh: line 33: ` else

  10. John Holder said,

    on December 1st, 2007 at 4:31 pm

    There seems to be something wrong with your command line interpreter.

    Try running it like this:
    /opt/zimbra/libexec/zmfixperms


  11. on May 28th, 2008 at 2:14 am

    Zimbra comments…

    Zimbra issues Folders in webclient showing deleted messages in new message count…

Leave a Reply

|  Blog Home

Subscribe

Zimbra RSS Feed

Subscribe by Email


Categories