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 example.org (10.0.0.1 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 example.org, 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 example.org hostname. New host will be zimbra.example.org (10.0.0.100 internally). This is going to be a VM under example.org 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 (zimbra.example.org) and oldhost (example.org) to distinguish them. Here is what all I did:
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 email@example.com:~
6. newhost: cd /opt
7. newhost: rm -rf zimbra
8. newhost: tar xvjpf ~/zimbra.tar.bz2
9. newhost: edit /etc/hosts, make example.org 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 zimbra.example.org
13. newhost: zmcontrol stop
14. newhost: edit the following files, changing port 6390 to 80, 6391 to 443, 6392 to 143, firstname.lastname@example.org to email@example.com, and any hostname (not domain) related example.org to zimbra.example.org:
- 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 zimbra.example.org zimbraMailPort 80 zimbraMailSSLPort 443
18. newhost: zmcontrol stop
19. newhost: get root back, remove the /etc/hosts example.org reference to this host
20. newhost: zmcontrol start
21. newhost: log into admin console for zimbra, set up new self signed ssl cert of *.example.org (and set the bottom hosts thing to zimbra.example.org and example.org) I also had to do a zmcontrol stop and zmcontrol start to catch the new certs.
22. oldhost: change the MX record for example.org to point to zimbra.vorpalcloud.org
23. oldhost: I set up postfix and relayhost = [10.0.0.100], mydestination = (yes, leave that blank), relay_domains = localhost, localhost.localdomain, example.org 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 10.0.0.100:80, 6391 to 10.0.0.100:443, 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 zimbra.example.org 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 ./install.sh
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