Migrate Zimbra From One Server To Another Server | Method-3 | Zimbra

Document
Alert! This article is written for Zimbra OSE users. As of December 2023, Synacor will no longer be providing support for Zimbra OSE. You might want to consider trying out Carbonio Community Edition – Zextras’s free and open-source email and collaboration platform.

For additional guidance, check out our community articles detailing the process of migrating from your current platform to Carbonio CE.

This is the last article in this series. Hope you find method-1 & method-2 informative and helpful. So without any further ado, let’s start the topic.

Overview of Method-3

Detail steps of Method-3

Step-1
Prepare A New Server

Set up your new server. In this method, the base operating system of the new server is not that important. So you can set up any operating system you like. If you need any hints regarding the operating system selection check out our article “Best Available Open-source Operating System for Zimbra Collaboration OSE“. You may also want to take a look at How To Prepare An OS For Zimbra Installation. Now set up Zimbra in the new server. Keep in mind that the Zimbra version should be the same as the old server. During this installation, we will use an option with the installer.

In OLD Server:
root@mail:/tmp/zcs-8.8.15_GA_4179.UBUNTU20_64.20211118033954# ./install.sh -s
Operations logged to /tmp/install.log.vB4E4n45
Checking for existing installation...
    zimbra-drive...NOT FOUND
    zimbra-imapd...NOT FOUND
    zimbra-patch...NOT FOUND
    zimbra-mta-patch...NOT FOUND
    zimbra-proxy-patch...NOT FOUND
    zimbra-license-tools...NOT FOUND

Output Concatenated

Running Post Installation Configuration:
Software Installation complete!
Operations logged to /tmp/install.log.eo0XwEmW
root@mail:/tmp/zcs-8.8.15_GA_4179.UBUNTU20_64.20211118033954#

Now you have a new Zimbra server with no user/email data. Keep it that way, we will come to it later.

Step-2
Hold all email transactions at the old server. You can use any external relays to store your incoming emails till your migration is done. After the successful migration, you shall get all stored emails from your relay server. Also, you should be able to receive emails from external senders to your new server. Take a look at the below-referred illustration.

zimbra migration steps

*** You need to modify your MX record as per your activity.

Step-3
Transfer Zimbra From Old Server To New Server

Before starting the transfer process, we have to do a critical task carefully.

Warning: Follow this instruction carefully
Remove all files from /opt/zimbra directory at the new server

root@mail:/tmp/zcs-8.8.15_GA_4179.UBUNTU20_64.20211118033954# cd /opt/zimbra/
root@mail:/opt/zimbra# rm -rf *

Transfer all files from /opt/zimbra of Old Server to New Server

[Make sure rsync is working properly between old and new servers]
root@mail:/home/carbonio# rsync --progress -avzHS -e ssh /opt/zimbra/* root@192.168.1.153:/opt/zimbra/
root@192.168.1.153's password:
sending incremental file list
config.46272
          2,657 100%    0.00kB/s    0:00:00 (xfr#1, ir-chk=1027/1028)
jetty -> jetty_base
mailboxd -> jetty_base
backup/
bin/
bin/antispam-mysql
          1,389 100%  193.78kB/s    0:00:00 (xfr#2, ir-chk=1097/1123)
bin/antispam-mysql.server
          5,273 100%  643.68kB/s    0:00:00 (xfr#3, ir-chk=1096/1123)
bin/antispam-mysqladmin
          1,224 100%  119.53kB/s    0:00:00 (xfr#4, ir-chk=1095/1123)
bin/ldap
          4,562 100%  445.51kB/s    0:00:00 (xfr#5, ir-chk=1094/1123)
bin/mysql
            973 100%   86.38kB/s    0:00:00 (xfr#6, ir-chk=1093/1123)
bin/mysql.server

[Output Concatenated]

zmstat/pid/zmstat-nginx.pid
              6 100%    0.01kB/s    0:00:00 (xfr#42175, to-chk=2/52402)
zmstat/pid/zmstat-proc.pid
              6 100%    0.01kB/s    0:00:00 (xfr#42176, to-chk=1/52402)
zmstat/pid/zmstat-vm.pid
              6 100%    0.01kB/s    0:00:00 (xfr#42177, to-chk=0/52402)

sent 1,277,305,685 bytes  received 841,931 bytes  1,859,123.81 bytes/sec
total size is 89,398,381,407  speedup is 69.94
root@mail:/home/carbonio#

Stop all Zimbra services.

root@mail:/opt/zimbra# su zimbra
zimbra@mail:~$
zimbra@mail:~$ zmcontrol stop
Host mail.example.com
        Stopping zmconfigd...Done.
        Stopping zimlet webapp...Done.
        Stopping zimbraAdmin webapp...Done.
        Stopping zimbra webapp...Done.
        Stopping service webapp...Done.
        Stopping stats...Done.
        Stopping mta...Done.
        Stopping spell...Done.
        Stopping snmp...Done.
        Stopping cbpolicyd...Done.
        Stopping archiving...Done.
        Stopping opendkim...Done.
        Stopping amavis...Done.
        Stopping antivirus...Done.
        Stopping antispam...Done.
        Stopping proxy...Done.
        Stopping memcached...Done.
        Stopping mailbox...Done.
        Stopping logger...Done.
        Stopping dnscache...Done.
        Stopping ldap...Done.
zimbra@mail:~$

Step-4
Fix all permissions.

root@mail:/opt/zimbra# /opt/zimbra/libexec/zmfixperms -extended -v
Fixing ownership and permissions on /opt/zimbra/conf
Fixing permissions on /opt/zimbra/conf/ca
Fixing permissions on /opt/zimbra/conf/ca/ca.pem
Fixing ownership and permissions on /opt/zimbra/conf/ldap-canonical.cf
Fixing ownership and permissions on /opt/zimbra/conf/ldap-slm.cf
Fixing ownership and permissions on /opt/zimbra/conf/ldap-transport.cf
Fixing ownership and permissions on /opt/zimbra/conf/ldap-vad.cf
Fixing ownership and permissions on /opt/zimbra/conf/ldap-vam.cf
Fixing ownership and permissions on /opt/zimbra/conf/ldap-vmd.cf
Fixing ownership and permissions on /opt/zimbra/conf/ldap-vmm.cf
Fixing permissions and ownership on /opt/zimbra/conf/imapd.crt
Fixing permissions and ownership on /opt/zimbra/conf/nginx.crt
Fixing permissions and ownership on /opt/zimbra/conf/slapd.crt
Fixing permissions and ownership on /opt/zimbra/conf/smtpd.crt
Fixing permissions and ownership on /opt/zimbra/conf/imapd.key
Fixing permissions and ownership on /opt/zimbra/conf/nginx.key
Fixing permissions and ownership on /opt/zimbra/conf/root.key
Fixing permissions and ownership on /opt/zimbra/conf/slapd.key
Fixing permissions and ownership on /opt/zimbra/conf/smtpd.key
Fixing permissions and ownership on /opt/zimbra/conf/zmssl.cnf
Fixing ownership and permissions on /var/log/zimbra.log
Fixing ownership and permissions on /opt/zimbra/conf/crontabs
Fixing ownership and permissions on /opt/zimbra/common/lib/jylibs
Fixing ownership and permissions on /opt/zimbra/lib
Fixing ownership and permissions on /opt/zimbra/db
Fixing ownership and permissions on /opt/zimbra/data/sasl2/state
Fixing ownership and permissions on /opt/zimbra/data/amavisd
Fixing ownership and permissions on /opt/zimbra/jetty
Fixing ownership and permissions on /opt/zimbra/ssl
Fixing ownership and permissions on /opt/zimbra/data/ldap
Fixing ownership and permissions on /opt/zimbra/logger/db
Fixing ownership and permissions on /opt/zimbra/zmstat
Fixing postfix related permissions
Fixing ownership and permissions on /opt/zimbra/data/postfix
Fixing ownership of /opt/zimbra/index
Fixing ownership of /opt/zimbra/backup
Fixing ownership of /opt/zimbra/redolog
Fixing ownership of /opt/zimbra/store
root@mail:/opt/zimbra#

Now again install Zimbra with the platform override option.

root@mail:/tmp/zcs-8.8.15_GA_4179.UBUNTU20_64.20211118033954# ./install.sh --platform-override

Operations logged to /tmp/install.log.OwCT5zbd
Checking for existing installation...
    zimbra-drive...FOUND zimbra-drive-1.0.13.1576152256-1.u20
    zimbra-imapd...NOT FOUND
    zimbra-patch...FOUND zimbra-patch-8.8.15.1658841204.p33-1.u20
    zimbra-mta-patch...FOUND zimbra-mta-patch-8.8.15.1658841204.p33-1.u20
    zimbra-proxy-patch...FOUND zimbra-proxy-patch-8.8.15.1658841204.p33-1.u20
    zimbra-license-tools...NOT FOUND
    zimbra-license-extension...NOT FOUND
    zimbra-network-store...NOT FOUND
    zimbra-network-modules-ng...NOT FOUND
    zimbra-chat...FOUND zimbra-chat-3.0.2.1655178187-1.u20
    zimbra-talk...NOT FOUND
    zimbra-ldap...FOUND zimbra-ldap-8.8.15.GA.4179.UBUNTU20.64
    zimbra-logger...FOUND zimbra-logger-8.8.15.GA.4179.UBUNTU20.64
    zimbra-mta...FOUND zimbra-mta-8.8.15.GA.4179.UBUNTU20.64
    zimbra-dnscache...FOUND zimbra-dnscache-8.8.15.GA.4179.UBUNTU20.64
    zimbra-snmp...FOUND zimbra-snmp-8.8.15.GA.4179.UBUNTU20.64
    zimbra-store...FOUND zimbra-store-8.8.15.GA.4179.UBUNTU20.64
    zimbra-apache...FOUND zimbra-apache-8.8.15.GA.4179.UBUNTU20.64
    zimbra-spell...FOUND zimbra-spell-8.8.15.GA.4179.UBUNTU20.64
    zimbra-convertd...NOT FOUND
    zimbra-memcached...FOUND zimbra-memcached-1.6.5-1zimbra8.7b1.20.04
    zimbra-proxy...FOUND zimbra-proxy-8.8.15.GA.4179.UBUNTU20.64
    zimbra-archiving...NOT FOUND
    zimbra-core...FOUND zimbra-core-8.8.15.GA.4179.UBUNTU20.64
ZCS upgrade from 8.8.15 to 8.8.15 will be performed.
Validating ldap configuration
LDAP validation succeeded.  Continuing.

----------------------------------------------------------------------
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

Checking current number of databases...

Do you want to verify message store database integrity? [Y] Y
Verifying integrity of message store databases.  This may take a while.
Starting mysqld...done.
mysqld is alive
No errors found
mysqld is alive
Stopping mysqld... done.

Use Zimbra's package repository [Y] Y

Warning: apt-key output should not be parsed (stdout is not a terminal)
Importing Zimbra GPG key

Configuring package repository

Checking for installable packages

Found zimbra-core (local)
Found zimbra-ldap (local)
Found zimbra-logger (local)
Found zimbra-mta (local)
Found zimbra-dnscache (local)
Found zimbra-snmp (local)
Found zimbra-store (local)
Found zimbra-apache (local)
Found zimbra-spell (local)
Found zimbra-memcached (repo)
Found zimbra-proxy (local)
Found zimbra-drive (repo)
Found zimbra-imapd (local)
Found zimbra-patch (repo)
Found zimbra-mta-patch (repo)
Found zimbra-proxy-patch (repo)


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] Y

Scanning for any new or additional packages available for installation
Existing packages will be upgraded
    Upgrading zimbra-core
    Upgrading zimbra-ldap
    Upgrading zimbra-logger
    Upgrading zimbra-mta
    Upgrading zimbra-dnscache
    Upgrading zimbra-snmp
    Upgrading zimbra-store
    Upgrading zimbra-apache
    Upgrading zimbra-spell
    Upgrading zimbra-memcached
    Upgrading zimbra-proxy
    Upgrading zimbra-drive

Install zimbra-imapd (BETA - for evaluation only) [N] Y
    Upgrading zimbra-patch
    Upgrading zimbra-mta-patch
    Upgrading zimbra-proxy-patch
    Upgrading zimbra-chat
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-dnscache
    zimbra-snmp
    zimbra-store
    zimbra-apache
    zimbra-spell
    zimbra-memcached
    zimbra-proxy
    zimbra-drive
    zimbra-imapd
    zimbra-patch
    zimbra-mta-patch
    zimbra-proxy-patch
    zimbra-chat

The system will be modified.  Continue? [N] Y

Beginning Installation - see /tmp/install.log.OwCT5zbd for details...

                          zimbra-core-components will be downloaded and installed.
                            zimbra-timezone-data will be installed.
                   zimbra-common-mbox-conf-attrs will be installed.
                          zimbra-common-core-jar will be installed.
                  zimbra-common-mbox-conf-rights will be installed.
                         zimbra-common-core-libs will be installed.
                    zimbra-common-mbox-conf-msgs will be installed.
                           zimbra-common-mbox-db will be installed.
                         zimbra-common-mbox-docs will be installed.
                   zimbra-common-mbox-native-lib will be installed.
                         zimbra-common-mbox-conf will be installed.
                                     zimbra-core will be installed.
                          zimbra-ldap-components will be downloaded and installed.
                                     zimbra-ldap will be installed.
                                   zimbra-logger will be installed.
                           zimbra-mta-components will be downloaded and installed.
                                      zimbra-mta will be installed.
                      zimbra-dnscache-components will be downloaded and installed.
                                 zimbra-dnscache will be installed.
                          zimbra-snmp-components will be downloaded and installed.
                                     zimbra-snmp will be installed.
                         zimbra-store-components will be downloaded and installed.
                       zimbra-jetty-distribution will be downloaded and installed.
                          zimbra-mbox-store-libs will be installed.
                                zimbra-mbox-conf will be installed.
                   zimbra-mbox-admin-console-war will be installed.
                                 zimbra-mbox-war will be installed.
                       zimbra-mbox-webclient-war will be installed.
                             zimbra-mbox-service will be installed.
                                    zimbra-store will be installed.
                        zimbra-apache-components will be downloaded and installed.
                                   zimbra-apache will be installed.
                         zimbra-spell-components will be downloaded and installed.
                                    zimbra-spell will be installed.
                                zimbra-memcached will be downloaded and installed.
                         zimbra-proxy-components will be downloaded and installed.
                                    zimbra-proxy will be installed.
                                    zimbra-drive will be downloaded and installed (later).
                                    zimbra-imapd will be installed.
                                    zimbra-patch will be downloaded and installed (later).
                                zimbra-mta-patch will be downloaded and installed (later).
                              zimbra-proxy-patch will be downloaded and installed (later).
                                     zimbra-chat will be downloaded and installed (later).

Downloading packages (11):
   zimbra-core-components
   zimbra-ldap-components
   zimbra-mta-components
   zimbra-dnscache-components
   zimbra-snmp-components
   zimbra-store-components
   zimbra-jetty-distribution
   zimbra-apache-components
   zimbra-spell-components
   zimbra-memcached
   zimbra-proxy-components
      ...done

Saving existing configuration file to /opt/zimbra/.saveconfig

Shutting down zimbra mail

Backing up the ldap database...done.

Removing existing packages

   zimbra-drive...done
   zimbra-patch...done
   zimbra-mta-patch...done
   zimbra-proxy-patch...done
   zimbra-chat...done
   zimbra-ldap...done
   zimbra-logger...done
   zimbra-mta...done
   zimbra-dnscache...done
   zimbra-snmp...done
   zimbra-store...done
   zimbra-spell...done
   zimbra-memcached...done
   zimbra-core...done

Removing deployed webapp directories

Installing repo packages (11):
   zimbra-core-components
   zimbra-ldap-components
   zimbra-mta-components
   zimbra-dnscache-components
   zimbra-snmp-components
   zimbra-store-components
   zimbra-jetty-distribution
   zimbra-apache-components
   zimbra-spell-components
   zimbra-memcached
   zimbra-proxy-components
      ...done

Installing local packages (27):
   zimbra-timezone-data
   zimbra-common-mbox-conf-attrs
   zimbra-common-core-jar
   zimbra-common-mbox-conf-rights
   zimbra-common-core-libs
   zimbra-common-mbox-conf-msgs
   zimbra-common-mbox-db
   zimbra-common-mbox-docs
   zimbra-common-mbox-native-lib
   zimbra-common-mbox-conf
   zimbra-core
   zimbra-ldap
   zimbra-logger
   zimbra-mta
   zimbra-dnscache
   zimbra-snmp
   zimbra-mbox-store-libs
   zimbra-mbox-conf
   zimbra-mbox-admin-console-war
   zimbra-mbox-war
   zimbra-mbox-webclient-war
   zimbra-mbox-service
   zimbra-store
   zimbra-apache
   zimbra-spell
   zimbra-proxy
   zimbra-imapd
      ...done

Installing extra packages (5):
   zimbra-drive
   zimbra-patch
   zimbra-mta-patch
   zimbra-proxy-patch
   zimbra-chat
      ...done

Running Post Installation Configuration:

Setting defaults from saved config in /opt/zimbra/.saveconfig/config.save
   HOSTNAME=mail.example.com
   LDAPHOST=mail.example.com
   LDAPPORT=389
   SNMPTRAPHOST=mail.example.com
   SMTPSOURCE=admin@example.com
   SMTPDEST=admin@example.com
   SNMPNOTIFY=yes
   SMTPNOTIFY=yes
   LDAPROOTPW=*
   LDAPZIMBRAPW=*
   LDAPPOSTPW=*
   LDAPREPPW=*
   LDAPAMAVISPW=*
   LDAPNGINXPW=*
Restoring existing configuration file from /opt/zimbra/.saveconfig/localconfig.xml...done
Operations logged to /tmp/zmsetup.20220825-121704.log
Adding /opt/zimbra/conf/ca/ca.pem to cacerts
Checking ldap status....not running.
Starting ldap...done.
Setting defaults...sh: 1: /sbin/ifconfig: not found
done.
Setting defaults from existing config...done.
Checking for port conflicts
sh: 1: netstat: not found
Setting defaults from ldap...done.
Saving config in /opt/zimbra/config.81144...done.
Operations logged to /tmp/zmsetup.20220825-121704.log
Setting local config values...done.
Initializing core config...Setting up CA...done.
Deploying CA to /opt/zimbra/conf/ca ...done.
Setting replication password...done.
Setting Postfix password...done.
Setting amavis password...done.
Setting nginx password...done.
Creating server entry for mail.example.com...already exists.
Setting Zimbra IP Mode...done.
Saving CA in ldap...done.
Saving SSL Certificate in ldap...done.
Setting spell check URL...done.
Setting service ports on mail.example.com...done.
Setting Keyboard Shortcut Preferences...done.
Setting zimbraFeatureTasksEnabled=TRUE...done.
Setting zimbraFeatureBriefcasesEnabled=TRUE...done.
Setting Master DNS IP address(es)...done.
Setting DNS cache tcp lookup preference...done.
Setting DNS cache udp lookup preference...done.
Setting DNS tcp upstream preference...done.
Updating zimbraLDAPSchemaVersion to version '1649766200'
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mail.example.com...done.
Adding mail.example.com to zimbraMailHostPool in default COS...done.
Creating user spam.uyn1iiq_@example.com...already exists.
Creating user ham.lz0gvh921e@example.com...already exists.
Creating user virus-quarantine.vcrgu214f@example.com...already exists.
Setting spam training and Anti-virus quarantine accounts...done.
Configuring SNMP...done.
Setting up syslog.conf...done.
Enabling IMAP protocol for zimbra-imapd service...done.
Enabling IMAPS protocol for zimbra-imapd service...done.
Starting servers...done.
Enabling jetty logging...done.
Checking for deprecated zimlets...done.
Checking for network zimlets in LDAP...done.
Removing network zimlets...
Finished removing network zimlets.
Installing common zimlets...
        com_zimbra_adminversioncheck...done.
        com_zimbra_mailarchive...done.
        com_zimbra_srchhighlighter...done.
        com_zextras_chat_open...done.
        com_zimbra_webex...done.
        com_zimbra_viewmail...done.
        com_zimbra_clientuploader...done.
        com_zimbra_tooltip...done.
        com_zimbra_email...done.
        com_zimbra_date...done.
        com_zimbra_ymemoticons...done.
        com_zimbra_attachcontacts...done.
        com_zimbra_cert_manager...done.
        com_zimbra_url...done.
        com_zimbra_phone...done.
        com_zimbra_attachmail...done.
        com_zimbra_proxy_config...done.
        com_zextras_drive_open...done.
        com_zimbra_bulkprovision...done.
Finished installing common zimlets.
Getting list of all zimlets...done.
Updating non-standard zimlets...
Finished updating non-standard zimlets.
Restarting mailboxd...done.
Skipping creation of default domain GAL sync account - existing install detected.

You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Server.
The only information that will be transmitted is:
        The VERSION of zcs installed (8.8.15_GA_4179_UBUNTU20_64)
        The ADMIN EMAIL ADDRESS created (admin@example.com)

Notify Zimbra of your installation? [Yes] No
Notification skipped
Checking if the NG started running...done.
Setting up zimbra crontab...done.

Moving /tmp/zmsetup.20220825-121704.log to /opt/zimbra/log

Configuration complete - press return to exit

root@mail:/tmp/zcs-8.8.15_GA_4179.UBUNTU20_64.20211118033954#

Now your new server is ready with all the user accounts and previous data.

Step-5
Now it’s time to activate your new server. First, release your emails from the external relay to your new server. Then make necessary changes in your DNS record to make your new server active.

With this step, you have migrated your server successfully.

We hope you have enjoyed all three articles regarding the migration process. All these methods are manual and need human intervention from time to time. There are chances that they may not work as they intend to due to various reasons.

Therefore, if your data is critical to you, we would recommend you get an enterprise-level, automatic process to migrate your server. Is there anything else in your mind better than Zextras Suite?

That’s all for today.

:slight_smile:
Download Zextras Suite for Zimbra OSE

Post your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Migrate Zimbra From One Server To Another Server | Method-2 | Zimbra
A Tour Of main.cf (Postfix) In Your Email Server | Carbonio CE