Zimbra to Zimbra Migration

Zimbra to Zimbra Migration

   KB 15282        Last updated on 2015-11-5  




0.00
(0 votes)

Important Note

The zmztozmig tool has very limited functionality and there are currently a number of known issues with it. There are better ways to achieve what zmztozmig was originally intended to do.

Therefore, Zimbra recommends NOT using this tool, or any other method using the REST interface. You can find more information in Bug 101760

Introduction

Here are the recommended Articles you can use to migrate your Server:

Other Community articles using imapsync (just for IMAP)

Known Issues

The zmztomig Tool has some Known Issues that must be considered before use it:

  • Personas will not be migrated
  • Identities will not be migrated
  • Domain Resources will not be migrated
  • COS will not be Migrated
  • User Preferences will not be migrated
  • Shared resources will not work after the migration and must be shared with all users again.
  • When you have Huge Mailboxes, the Tool often randomly fails to migrate some of the data. Please use the CURL export for these Mailboxes, and import them manually in the new Server.
  • More detailed issues in Bug 101760

Importing Data between Different Version of ZCS servers using the Zimbra to Zimbra Migration Tool

Use the Zimbra to Zimbra migration tool zmztozmig to import account data from one Zimbra Collaboration Server to another Zimbra Collaboration Server that is running a different version of ZCS. This tool can be used to import files from ZCS 6.0.6 or later to the latest version of ZCS.

The process of migrating accounts to a ZCS server running a later version of ZCS includes:

  • Provisioning the accounts on the destination server before running zmztozmig
  • Editing the zmztozmig.conf file in /opt/zimbra/conf on the destination server to configure the import settings
  • Running zmztozmig to import the account’s data to the destination server

When zmztozmig is used to import files, after the data is imported, the data in the accounts on the destination server are not an exact replica of the data in the accounts on the source server. And account preferences are not imported. Also, if the destination accounts do not have the same account IDs as they had on the source server, files that were shared and appointments related to the original sender might not work.

Note: Since 7.1.3 Zimbra includes a new zmmboxmove command that has enhanced functionality of zmmailboxmove to handle cross mailstore version migrations (but not across ldap instance like zmztozmig). So, keep using zmmailboxmove or zmmboxmove to migrate accounts between accounts with the same LDAP Master.

Import and provision accounts from the source LDAP

1. The first step is to import all the accounts that you want to migrate from one server to another server. Here is an example of the environment:

  • Old Zimbra Collaboration Server (Could be ZCS 7.0 and above) - 192.168.211.20
  • New Zimbra Collaboration Server (For example with ZCS 8.6) - 192.168.211.129

Zimbra to Zimbra Migration

2. Log in on the Destination Server, and go to Tools & Migration > Account Migration > Migration Wizard.

Zimbra to Zimbra Migration

3. Select the options in the wizard and click Next:

  • Type of mail server: Zimbra Collaboration Suite
  • Would you like to import account records? Yes
  • Would you like to import the mail? No

Zimbra to Zimbra Migration

4. Select the option Import from antoher Zimbra LDAP directory and click Next.

Zimbra to Zimbra Migration

5. Select the option that fits with your environment. For example:

  • Don't generate random passwords
  • Select to use the same password for all accounts
  • Require that the user needs to change their password after the first login
  • Select SMTP Host <- The best option here is don't put any SMTP Host here.

Zimbra to Zimbra Migration

This is the Configuration of the Source LDAP, be sure that you can access the source LDAP. Complete these fields with your own data:

  • LDAP URL: Can be a hostname of the source Zimbra Collaboration Server, or just the IP.
  • Bind DN: Should be per default uid=zimbra,cn=admins,cn=zimbra but just in case check in the source Zimbra Collaboration Server with the next command
   zmlocalconfig -s zimbra_ldap_userdn
  • Bind password: Run the next command in the source Zimbra Collaboration Server to obtain the password
   zmlocalconfig -s zimbra_ldap_password
  • LDAP Filter: Should be the default one, (objectclass=zimbraAccount)
  • LDAP search base: Add the domain or domains that you want to migrate, for example, dc=example,dc=com

Zimbra to Zimbra Migration

6. Be sure that all the accounts to migrate are in the next screen, these are taken automatically from the source Zimbra LDAP. Click Next, and the process starts.

Zimbra to Zimbra Migration

7. Click Next.

Zimbra to Zimbra Migration

8. Select accounts to import and click Next.

Zimbra to Zimbra Migration

9. Select the accounts that you want to migrate and click Next.

Zimbra to Zimbra Migration

10. Select the source Zimbra Collaboration Server IP, the IMAP over SSL, add an account and password with privileges, click Next.

Zimbra to Zimbra Migration

11. An overview of the accounts that will be migrated displays. Click Next and the wizard start the migration.

Zimbra to Zimbra Migration

Zimbra to Zimbra Migration

12. The Progress screen displays errors, this is normal.

Zimbra to Zimbra Migration

13. If you return to the accounts view, all of the accounts are migrated, but the data is not migrated yet.

Zimbra to Zimbra Migration

Preparing the zmztozmig.conf file

Edit the zmztozmig.conf file in /opt/zimbra/conf on the destination server to configure the import settings. Account data, including email messages, attachments, contacts, calendar, tasks and briefcase folders for accounts are imported as individual account tgz tar files. Content of the Junk and Trash folders are not imported.

The following information is configured in the file:

  • Login information of the source server
  • Login information of the destination server
  • Domain mapping from source server to destination server
  • Account import details, including which accounts’ to import from and what type of information should be imported
  • Record keeping information, including log directory, whether to keep the tar files after migration, directory for failed migration files
  • How to resolve account import conflicts (resolve)
  • Number of mailboxes to import simultaneously (thread)
  • (Optional) Changes to ZimbraMailTransport that may be required

Following is a description of the parameters that are edited in the zmztozmig.conf file.

Parameter Description Entered as
SourceZCSServer IP address or name of the source server. SourceZCSServer=<source.com>
SourceAdminUser ZCS administrator name for the source server. SourceAdminUser=<sourceadmin>
SourceAdminPwd ZCS administrator password for the source server. SourceAdminPwd=<adminpswrd>
SourceAdminPort Source server admin port - 7071 SourceAdminPort=<port>
TargetZCSServer IP address or name of the destination server where the data is imported. TargetZCSServer=<destination.com>
TargetAdminUser ZCS administrator name for the destination server. TargetAdminUser=<targetadmin>
TargetAdminPwd ZCS administrator password for the destination server. TargetAdminPwd=<adminpswrd>
TargetAdminPort Destination server admin port- 7071. TargetAdminPort=<port>
Threads Set the number of accounts to be imported simultaneously. The default is 1.

Set this at a low number of threads. When you start to import the data, review the source/destination ZCS server CPU usage I/O rate and write to disk per second. If the server has power to run more threads, you can edit the zmztozmig.conf file to increase the threads one at a time.

Threads=<n>
WorkingDirectory The directory path to where the tar’d account data files are downloaded. WorkingDirectory=/opt/zimbra/data/zmztozmig/work
FailedDirectory The directory path to where tar’d account data files are moved if the account import fails. FailedDirectory=/opt/zimbra/data/zmztozmig/failed
KeepSuccessFiles KeepSuccessFiles is set to FALSE. The tar files are deleted after the data is imported.

If you want to keep the downloaded tar files after they are imported, set this to TRUE.

KeepSuccessFiles=FALSE
SuccessDirectory If you set KeepSuccessFiles to TRUE, identify the directory where tar’d account files are moved after successful imported. SuccessDirectory=/opt/zimbra/data/zmztozmig/successes
LogDirectory A common log file, ztozlog*.log, is created for the complete import process and separate log file are created for each account data file that is imported.

Configure the directory location where log files are saved.

LogDirectory=/opt/zimbra/data/zmztozmig/logs
DomainMap If accounts are being migrated from one domain to another domain, specify the source domain and destination domain.

You can create multiple DomainMap entries if the Accounts list contains accounts from different domains.

DomainMap=fromdomain.com todomain.com
Accounts Specify which account’s data should be imported. This is a comma separated list of accounts.

If data from all accounts on the source server should be imported, enter all.

The Domains parameter must be set to list the domain from which the files are being imported.

Accounts=test1@example.com,test2@example.com

Or Accounts=all

Domains When the Accounts parameter is set to all, identify the domains. Domains=domain1.example.com, domain2.example.com
Types Specify the type of data that should be imported. This is a comma separated list.

To import all content, do not set any values for “types” Comment it out.

Types=message, conversation

Types are:

  • message
  • conversation
  • contact
  • appointment
  • task
  • briefcase
Resolve Use Resolve to determine how to resolve conflicts between the items being imported and the items already in the destination account.

Only one value at a time can be set.

Values:

  • Skip ignores duplicates
  • Modify updates older items
  • Reset deletes the older subfolders
  • Replace means replace the existing items with the items being imported
Resolve=skip


ZimbraMailTransport Using ZimbraMailTransport is optional.

Include this entry if you want to change the ZimbraMailTransport to some other MTA.

ZimbraMailTransport=smtp:mta.zcs.mail.mydomain.com

Example of zmztozmig.conf

An example of the zmztozmig.conf file looks like:

#Source ZCS server IP/name,admin user name and password, server port
SourceZCSServer=192.168.211.20
SourceAdminUser=admin
SourceAdminPwd=PASSADMIN
SourceAdminPort=7071
#Destination/Target ZCS server IP/name,admin user name and password, server port
TargetZCSServer=192.168.211.129
TargetAdminUser=admin
TargetAdminPwd=PASSADMIN
TargetAdminPort=7071
Threads=3
WorkingDirectory=/tmp/ztozmig/mailboxdumps/
FailedDirectory=/tmp/ztozmig/mailboxfailures/
SuccessDirectory=/tmp/ztozmig/successes/
LogDirectory=/opt/zimbra/log/ztozmiglogs
KeepSuccessFiles=FALSE
Domains=zimbra.local
Accounts=all

Import Account Data to the New Zimbra Server

Run the zmztozmig migration tool on the destination server as zimbra.

/opt/zimbra/libexec/zmztozmig –f /opt/zimbra/conf/zmztozmig.conf

The data on the source server is zipped and imported to the destination server. If you configured KeepSuccessFiles to FALSE, the tgz file is deleted by default once the account data is imported.

A common log file, ztozlog*.log, is created for the complete process and separate log files are created for data of each account that is imported. These should be saved until the new account data has been verified.

This is the end of the import process. An overview of the migration displays:

[INFO|main:1| 03/18/2015 20:34:57]: ****************SUMMARY************************** 
[INFO|main:1| 03/18/2015 20:34:57]: Total Accounts processed         :    7 
[INFO|main:1| 03/18/2015 20:34:57]: Successfull Accounts             :    7 
[INFO|main:1| 03/18/2015 20:34:57]: Failed accounts                  :    0 
[INFO|main:1| 03/18/2015 20:34:57]: Total Migration Time(seconds)    :    157.949 
[INFO|main:1| 03/18/2015 20:34:57]: ************************************************* 

Check the differences between Zimbra Collaboration Servers

Now that everything is imported, check the differences between accounts, for example in the Mail Tab:

Zimbra to Zimbra Migration

Or, even in the Calendar Tab:

Zimbra to Zimbra Migration

Note that because the MailboxID is different after the migration, any shared resources will not work. Also, the zmztomig did not migrate the resources of the domain or the user preferences.

After you verify that the account data was imported correctly, you can delete the account on the source server.

Verified Against: ZCS 8.6, 8.5, 8.0.x, 7.x Date Created: 10/10/2011
Article ID: https://wiki.zimbra.com/index.php?title=Zimbra_to_Zimbra_Migration Date Modified: 2015-11-05



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search