I had an Zimbra Collaboration Open Source server on an old CentOS 6 distribution that I wanted to upgrade.
Since CentOS will be discontinued at the end of 2021, I needed to move to another GNU/Linux platform.
As there is not many choices, I decided to migrate to Ubuntu Server as the 20.04 LTS version is recently supported by Zimbra Collaboration Open Source Edition.
⚠️ To migrate, the version of Zimbra must be the same on both servers.⚠️
On the old server we will stop zimbra service and copy files to new server.
After these few tasks we can stop the server permanently.
zimbra@zcs:~$ /opt/zimbra/libexec/zmstat-cleanup --keep 30
root@host:~# su - zimbra zimbra@zcs:~$ zmcontrol stop
root@host:~# rsync -e ssh -axvzKHS /opt/zimbra [newserver-IP-address]:/opt/ZIMBRA_TMPNote : as we cannot rsync to the root user on a Ubuntu (see here), it will be easier to rsync from the new server.
zimbra@zcs:~$ /opt/zimbra/libexec/zmslapcat /tmp/LDAP
zimbra@zcs:~$ /opt/zimbra/libexec/zmslapcat -c /tmp/LDAP
zimbra@zcs:~$ /opt/zimbra/libexec/zmslapcat -a /tmp/LDAP
root@host:~# rsync -e ssh -axvzKHS /tmp/LDAP [newserver-IP-address]:/opt/
It won't be necessary but we can retrieve old passwords.
<key name="zimbra_ldap_password"> <value>TXrP9mSTd</value> </key>
zimbra@zcs:~$ zmlocalconfig -s | grep "ldap_amavis_password\|ldap_nginx_password\|ldap_postfix_password\|ldap_replication_password\|ldap_root_password\|zimbra_ldap_password"
root@host:~# hostname zcs.shebangthedolphins.net
root@host:~# poweroff
We assume here that a server version of Ubuntu has been freshly installed.
To connect as root user I used the command sudo su -
# This is the network config written by 'subiquity'
network:
ethernets:
ens160:
addresses:
- 192.168.1.10/24
gateway4: 192.168.1.254
nameservers:
search: [shebangthedolphins.net]
addresses: [192.168.1.254]
version: 2
root@host:~# netplan apply
root@host:~# hostnamectl set-hostname zcs.shebangthedolphins.net
127.0.0.1 localhost 192.168.1.10 zcs.shebangthedolphins.net shebangthedolphins.net # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback localhost fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
[Resolve] #DNS= #FallbackDNS= #Domains= #LLMNR=no #MulticastDNS=no #DNSSEC=no #DNSOverTLS=no #Cache=no-negative DNSStubListener=no #ReadEtcHosts=yes
root@host:~# systemctl stop systemd-resolved
root@host:~# rm /etc/resolv.conf
root@host:~# reboot
root@host:~# echo "nameserver 192.168.1.254 search shebangthedolphins.net" > /etc/resolv.conf
root@host:~# resolvectl query shebangthedolphins.net shebangthedolphins.net: 192.168.1.10 -- Information acquired via protocol DNS in 2.4ms. -- Data is authenticated: yes
root@host:~# tar xzvf zcs-8.8.15_BETA_4155.UBUNTU20_64.20210924020007.tgz
root@host:~# cd zcs-8.8.15_BETA_4155.UBUNTU20_64.20210924020007 && ./install.sh -s […] ---------------------------------------------------------------------- PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE. SYNACOR, INC. ("SYNACOR") WILL ONLY LICENSE THIS SOFTWARE TO YOU IF YOU FIRST ACCEPT THE TERMS OF THIS AGREEMENT. BY DOWNLOADING OR INSTALLING THE SOFTWARE, OR USING THE PRODUCT, YOU ARE CONSENTING TO BE BOUND BY THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL OR USE THE PRODUCT. License Terms for this Zimbra Collaboration Suite Software: https://www.zimbra.com/license/zimbra-public-eula-2-6.html ---------------------------------------------------------------------- Do you agree with the terms of the software license agreement? [N] Y Use Zimbra's package repository [Y] Y
Select the packages to install Install zimbra-ldap [Y] Install zimbra-logger [Y] Install zimbra-mta [Y] Install zimbra-dnscache [Y] N Install zimbra-snmp [Y] N Install zimbra-store [Y] Install zimbra-apache [Y] N Install zimbra-spell [Y] Install zimbra-memcached [Y] Install zimbra-proxy [Y] Install zimbra-drive [Y] N Install zimbra-imapd (BETA - for evaluation only) [N] Install zimbra-chat [Y] N Checking required space for zimbra-core Checking space for zimbra-store Checking required packages for zimbra-store zimbra-store package check complete. Installing: zimbra-core zimbra-ldap zimbra-logger zimbra-mta zimbra-store zimbra-apache zimbra-spell zimbra-memcached zimbra-proxy zimbra-patch zimbra-mta-patch zimbra-proxy-patch The system will be modified. Continue? [N] Y
root@host:~# rm -rf /opt/zimbra/
root@host:~# mv /opt/ZIMBRA_TMP/zimbra /opt/
root@host:~# cd /opt/zimbra/data/ldap; mv mdb /tmp/mdb.old
root@host:~# mkdir -p mdb/db
root@host:~# cd /opt/zimbra/data/ldap; mv config /tmp/config.old
root@host:~# mkdir config
root@host:~# cd /opt/zimbra/data/ldap; mv accesslog /tmp/accesslog.old
root@host:~# mkdir -p accesslog/db
root@host:~# /opt/zimbra/libexec/zmfixperms -e -v
root@host:~# chown -R zimbra:zimbra /opt/LDAP
root@host:~# su - zimbra
zimbra@zcs:~$ /opt/zimbra/libexec/zmslapadd -c /opt/LDAP/ldap-config.bak
zimbra@zcs:~$ /opt/zimbra/libexec/zmslapadd /opt/LDAP/ldap.bak
zimbra@zcs:~$ /opt/zimbra/libexec/zmslapadd -a /opt/LDAP/ldap-accesslog.bak
root@host:~# touch /var/log/zimbra-stats.log root@host:~# chown zimbra:zimbra /var/log/zimbra-stats.log
root@host:~# echo "%zimbra ALL=NOPASSWD:/opt/zimbra/libexec/zmstat-fd * %zimbra ALL=NOPASSWD:/opt/zimbra/libexec/zmslapd %zimbra ALL=NOPASSWD:/opt/zimbra/postfix/sbin/postfix, /opt/zimbra/postfix/sbin/postalias, /opt/zimbra/postfix/sbin/qshape.pl, /opt/zimbra/postfix/sbin/postconf,/opt/zimbra/postfix/sbin/postsuper %zimbra ALL=NOPASSWD:/opt/zimbra/libexec/zmqstat,/opt/zimbra/libexec/zmmtastatus %zimbra ALL=NOPASSWD:/opt/zimbra/amavisd/sbin/amavis-mc %zimbra ALL=NOPASSWD:/opt/zimbra/libexec/zmunbound %zimbra ALL=NOPASSWD:/sbin/resolvconf * %zimbra ALL=NOPASSWD:/opt/zimbra/libexec/zmmailboxdmgr %zimbra ALL=NOPASSWD:/opt/zimbra/bin/zmcertmgr %zimbra ALL=NOPASSWD:/opt/zimbra/bin/zmmailboxdctl %zimbra ALL=NOPASSWD:/opt/zimbra/bin/zmmailbox %zimbra ALL=NOPASSWD:/opt/zimbra/bin/zmdnscachectl" >> /etc/sudoers
root@host:~# ./install.sh -s […] The Zimbra Collaboration Server appears to already be installed. It can be upgraded with no effect on existing accounts, or the current installation can be completely removed prior to installation for a clean install. Do you wish to upgrade? [Y] […] The system will be modified. Continue? [N] Y
root@host:~# su - zimbra
zimbra@zcs:~$ zmcontrol start
And that's pretty much it…
One last thing… I had Disk Space Monitoring alerts for Loop Devices, I had to disable it (for my loop devices) to shut him up.
zimbra@zcs:~$ zmlocalconfig -e zmstat_df_excludes='/dev/loop0:/dev/loop1:/dev/loop2:/dev/loop3:/dev/loop4:/dev/loop5:/dev/loop6'
zimbra@zcs:~$ zmcontrol start
Contact :