Results 1 to 10 of 10

Thread: Migrating from one server to another and upgrading from 4.5 to 5.0 AND port changes

Threaded View

  1. #1
    Join Date
    Oct 2007
    Garner, NC, USA
    Rep Power

    Talking Migrating from one server to another and upgrading from 4.5 to 5.0 AND port changes

    Hi Folk! I just successfully upgraded and moved my server and since it was pretty complex and someone else may try the same thing, I thought I'd post what I did.

    First off, I used this as a reference:

    So... here's the scenario. I have a primary server, we'll call it ( internally). It handles DNS, NAT/being the internal primary router, and just about everything. To start with, it is running Zimbra. This box is running CentOS 4.6 and Zimbra 4.5.10. The mail domain is, same as the host. Now, seeing as I had HTTP and LDAP services of my own, I was changed the following Zimbra ports:
    - HTTP (80) -> 6390
    - HTTPS (443) -> 6391
    - LDAP (143) -> 6392

    I want to move this to another CentOS 4.6 box, move the ports back to their original locations, still allow port 6390/6391 to work, and upgrade to Zimbra 5. I will also need to change the hostname since the original server will retain the hostname. New host will be ( internally). This is going to be a VM under actually, but this isn't really important.

    So, pretty complex procedure. Had a number of failures at first but finally nailed it. I'm going to prefix these things with newhost ( and oldhost ( to distinguish them. Here is what all I did:

    Initial Migration

    1. newhost: just in case I was trying things before, make sure all of the zimbra RPMs are not installed
    2. newhost: download zimbra package, and: install -s (software only install)
    3. newhost: edit /etc/passwd and /etc/group and make the zimbra and postfix users and groups have the same uid and gid as they have on oldhost
    4. oldhost: tar up current zimbra install (cd /opt; tar cvjpf zimbra.tar.bz2 zimbra) this takes a while and there are a number of other ways you can do this
    5. oldhost: scp zimbra.tar.bz2
    6. newhost: cd /opt
    7. newhost: rm -rf zimbra
    8. newhost: tar xvjpf ~/zimbra.tar.bz2
    9. newhost: edit /etc/hosts, make resolve to this host for now
    10. newhost: su - zimbra
    11. newhost: zmcontrol start (now, the logger job failed for me once here, i just did a zmcontrol stop, make sure to clean up all zimbra processes, and zmcontrol start again and it was fine the next time)
    12. newhost: /opt/zimbra/libexec/zmsetservername
    13. newhost: zmcontrol stop
    14. newhost: edit the following files, changing port 6390 to 80, 6391 to 443, 6392 to 143, to, and any hostname (not domain) related to
    - conf/swatchrc
    - conf/amavisd.conf
    - conf/localconfig.xml
    - postfix/conf/
    - cyrus-sasl/etc/saslauthd.conf
    - ssl/ssl/zmssl.cnf (needed to get root to change this one)
    15. newhost: /opt/zimbra/libexec/zmmtainit
    16. newhost: zmcontrol start
    17. newhost: zmprov ms zimbraMailPort 80 zimbraMailSSLPort 443
    18. newhost: zmcontrol stop
    19. newhost: get root back, remove the /etc/hosts reference to this host
    20. newhost: zmcontrol start
    21. newhost: log into admin console for zimbra, set up new self signed ssl cert of * (and set the bottom hosts thing to and I also had to do a zmcontrol stop and zmcontrol start to catch the new certs.
    22. oldhost: change the MX record for to point to
    23. oldhost: I set up postfix and relayhost = [], mydestination = (yes, leave that blank), relay_domains = localhost, localhost.localdomain, this set up all local mail to go through my new mail host
    24. oldhost: set up iptables rules to redirect external network traffic to port 6390 to, 6391 to, 25 to 10.0.0100:25
    25. oldhost: set up apache to answer also on 6390 and 6391 and set a rewrite rule to redirect to port 80 and port 443 (external world never sees this, but this took care of internal world)

    Ok, now we have migrated Zimbra 4.5 to the new host. I tried it out and make sure things were working right. Once I was happy with it, I went to upgrade to 5.0.

    26. newhost: set up PERLLIB and PERL5LIB variables for root's .bashrc to match zimbra's .bashrc
    27. newhost: . ~/.bashrc (to make sure perl vars are loaded)
    28. newhost: download zcs-5.0
    29. newhost: extract and ./

    At this point, all was working great! Complex, but I got through it! I know some of this could have been done via command line tools instead of direct file edits, but I preferred the manual edit method.

    I hope this can be helpful to someone else!
    Last edited by jadestorm; 03-17-2008 at 05:08 AM.
    The most addictive drug in the world is music.
    - The Lost Boyz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts