Data migration from Zimbra using Carbonio Backup

The main function of Carbonio Backup is to back up the mailboxes of Carbonio users. The backup created with its help can be used to restore data not only on the original server but also on a new server, ensuring the possibility of system recovery even in the event of physical destruction of the servers, as well as account migration, including when switching from Zimbra to Carbonio. In this guide, we will analyze the process of correctly extracting backup files from the system and restoring them.

This guide is only suitable for users of the commercial version of the Carbonio mail server. Please note that a trial license cannot be used for migration. Only a full license can be used.

Thanks to the compatibility of the Zextras Backup module from Zextras Suite for Zimbra OSE and Carbonio Backup, it can be used to migrate data from one system to another. To do this, you need to ensure the availability of backup data from the source server on the target server and restore accounts, domains, settings from the old system, and so on.

You can ensure the required visibility in two ways:

  • Copy the data to the backup path on the target server

  • Connect the storage in the backup path as NFS or S3 storage to the target server

In both cases, we will assume the path to connect the backup copy is the folder /opt/migration.

After ensuring data visibility, the administrator will be able to restore them on the new server. Depending on whether you will restore all data on the server or only individual domains, the approach to data recovery and the service downtime will vary.

  1. Full data recovery

When migrating all data at once, it is necessary to stop receiving and sending mail on the source server. This is done to prevent the copying process from overlapping with the writing process, which could result in data inconsistency. You can achieve this by closing the SMTP ports in the firewall or stopping the MTA service.

On the source server, run and wait for the command zxsuite --progress backup doSmartScan start to complete. This will create the most recent version of the data on the server, including even those emails that arrived just before stopping their reception.

Check the Zextras user permissions on the Carbonio server. He must have read permissions on the Zimbra backup files.

Start the recovery process from the backup using the external recovery function - carbonio --progress backup doExternalRestore /opt/migration. When it starts, accounts will begin to recover one by one.

In case you have many accounts, the process of restoring them one by one can take a long time. In this case, it is recommended to use the concurrent_accounts parameter. For example, the command carbonio --progress backup doExternalRestore /opt/migration concurrent_accounts 5 will start the process with parallel restoration of five accounts at once.

After the data migration is complete, it is recommended to run the built-in Carbonio data deduplication function, as even with hardware that supports hardware-level deduplication, it may not cope with its task when sequentially writing account data.

After the data migration is complete, the administrator only needs to redirect the mail flow to the new server.

  1. Migration of individual domains

When migrating data in split-domain format, where both systems remain functional and data is transferred between them one domain at a time, a mandatory requirement is different MTA node names on the source and target servers, as well as the ability of the source server to send mail to the MTA of the target server.

To make sure everything is set up correctly, create identical accounts on both servers:

  • On Zimbra - zmprov createAccount [email protected] ""

  • On Carbonio - carbonio prov createAccount [email protected] VeryStrongPassword

  • On the Zimbra server, change the incoming mail address parameter to the Carbonio MTA - zmprov modifyAccount [email protected] zimbraMailTransport smtp:carbonio-mta:25

After that, the email sent to [email protected] should arrive at the Carbonio server. If this does not happen, stop further actions until the reasons for the mail failure are established.

If everything works fine, proceed to the domain migration process. To do this, put the domain on the source server into maintenance mode using the command zmprov modifyDomain domain.ru zimbraDomainStatus maintenance

Run the command zxsuite --progress backup doSmartScan start on the source server. This will create the most up-to-date version of the data on the server, including even those emails that arrived just before the domain was put into maintenance mode.

Check the Zextras user permissions on the Carbonio server. He must have read permissions on the Zimbra backup files.

Start the restore process from the backup using the external restore function - carbonio --progress backup doExternalRestore /opt/migration domains domain.ru. By specifying the domain name for migration at the end of the command, data transfer will be limited to it only.

If there are many accounts in the domain, the process of restoring them one by one can take too much time. In this case, it is recommended to use the concurrent_accounts parameter. For example, the command carbonio --progress backup doExternalRestore /opt/migration domains domain.ru concurrent_accounts 5 will start the process with the simultaneous restoration of five accounts at once.

Since all accounts will move to the Carbonio server with the old settings, the administrator will need to change their zimbraMailTransport setting. An example script to achieve this:

for acc in (carbonio prov -l getAllAccounts | grep @domain.ru); do carbonio prov modifyAccount $acc zimbraMailTransport smtp:carbonio-mta:25"; done

After data migration, it is recommended to run the built-in Carbonio data deduplication function, as even hardware that supports deduplication at the hardware level may not cope with its task when sequentially writing account data.

After completing these actions, the administrator can close or completely delete the migrated domain on the source server.

The described domain transfer scenario can be used several times for gradual data transfer from one server to another. It is recommended not to forget to perform SmartScan to update the data in the backup before each domain migration. In addition, attention should be paid to the read permissions of the files in the backup.

  1. Zextras Drive Data Migration

To transfer files and folders stored in Zextras Drive to Carbonio Files, you need to install a separate package on the AppServer node.

apt install carbonio-drive-migration

After installation, run this program as the root user with the necessary parameters. An important point is to run the Zextras Drive migration program only after completing the import of the main data from the backup

carbonio-drive-migration -b /tmp/export -t https://mail.example.com/ -m /opt/zextras/backup/zextras/maps_[uuid]

The parameters in this command mean:

  • -b - the path where the exported backup copy is stored

  • -t - the public address of the Carbonio server (must match the value of the zimbraPublicServiceHostname parameter)

  • -m - the path to the file with the table of correspondence of user names on the source and target servers

As a result of such migration, all files and folders stored in Zextras Drive at the time of the backup export will be transferred. However, there are a number of limitations. Thus, neither public nor internal access rights to files and folders will be transferred along with the content. In addition, files from Zextras Drive that contain more versions than the limit set in Carbonio will be transferred as read-only files.

This means that if your file in Zextras Drive has 100 versions, and Carbonio is configured with a limit of 20 versions, then this file cannot be edited. To fix this, either increase the file version limit in Carbonio Files to match the number of versions of the transferred file, or delete the extra versions of the file so that their number matches the existing limit.

  1. Migration features

As part of such migration, the administrator can migrate all key objects such as domains, users, resources, aliases, static and dynamic mailing lists, as well as related data - emails, calendars, contacts, contact groups, shared folders, and even tags.

However, there is data that is not copied as part of this migration method. Among them are tasks, portfolio files, chats, color marks, and empty service classes.

Besides, after the migration, nested calendars and contacts may not be displayed. To make them appear, you need to move them from the folder they are in to the root folder.


Alt 1: Data migration from Zimbra using Carbonio Backup to ensure reliable backup and recovery.

To do this, get the list of user folders using the command carbonio prov selectMailbox [email protected] getAllFolders. In the list that appears, find the nested folder that is not displayed and remember its path. Then move it to the root folder

carbonio prov selectMailbox [email protected] renameFolder /Inbox/Emails /Emails

After that, the nested folder will start to appear in the web client in the main list of calendars and contacts.

For questions about testing, purchasing, licensing, and consultations, contact [email protected], the exclusive partner of Zextras.

You can get information and exchange information about Carbonio CE in the Telegram groups CarbonioMail and Carbonio CE Unofficial.

Carbonio Community Edition is intended only for small companies and for testing purposes

Comments