Migrating the cyrus-imapd backing store

Migrating the cyrus-imapd backing store to a new server, while at the same time changing the mailboxes domain, can be a bit tricky. The following procedure works for me.

These notes are for Kolab’s version of cyrus-imapd (2.5~dev2015021301-0~kolab1.1).

Stop all the services on the target machine that might interfere with the migration.

Make a backup of the target machine’s LDAP database. Delete the target DN ou=People,dc=(the mail domain), it will be restored in a later step.

For a new migration stop the target cyrus-imapd service and clean the directory structure.

Restore the DN ou=People,cn=(your domain) that you deleted above. Kolab will notice the change in the LDAP directory and recreate the mailbox structure in the cyrus-imapd spool files.

Now synchronize the backinstore with imapsync.

Imapsync might have a problem finding the mailbox folders. Notice the difference specifying a domain can make.