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.
1 2 3 4 |
service wallace stop service postfix stop service kolab-server stop service kolab-saslauthd stop |
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
cd /var/lib/imap service cyrus-imapd stop rm [a-z]*db rm -rf db/* # Kolab may already have setup the proper quotas # rm -rf domain/* rm -rf /var/spool/imap/domain/* rm -rf /var/lib/imap/lock/* # cp -rp /root/migrate-cyrus-imapd/vsi-work/domain /var/spool/imap service cyrus-imapd start service kolab-saslauthd start service kolab-server start service postfix start service wallace start |
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
candlish@w530:~$ openssl s_client -connect 10.0.0.2:993 -quiet depth=0 C = CH, ST = Bern, L = Roggwil, O = Atelier John Candlish, OU = internet mail services, CN = mail.candlish.net, emailAddress = postmaster@mail.candlish.net verify error:num=18:self signed certificate verify return:1 depth=0 C = CH, ST = Bern, L = Roggwil, O = Atelier John Candlish, OU = internet mail services, CN = mail.candlish.net, emailAddress = postmaster@mail.candlish.net verify return:1 * OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE AUTH=PLAIN AUTH=LOGIN SASL-IR] dmz server ready A login <span style="color: #800000">someuser.mailbox</span> ThePassword A OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY CATENATE CONDSTORE ESEARCH SORT SORT=MODSEQ SORT=DISPLAY THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE LIST-EXTENDED WITHIN QRESYNC SCAN XLIST URLAUTH URLAUTH=BINARY LOGINDISABLED AUTH=PLAIN AUTH=LOGIN COMPRESS=DEFLATE IDLE] User logged in SESSIONID= A list "" "*" A OK Completed (0.000 secs) A logout * BYE LOGOUT received A OK Completed read:errno=0 candlish@w530:~$ openssl s_client -connect 10.0.0.2:993 -quiet depth=0 C = CH, ST = Bern, L = Roggwil, O = Atelier John Candlish, OU = internet mail services, CN = mail.candlish.net, emailAddress = postmaster@mail.candlish.net verify error:num=18:self signed certificate verify return:1 depth=0 C = CH, ST = Bern, L = Roggwil, O = Atelier John Candlish, OU = internet mail services, CN = mail.candlish.net, emailAddress = postmaster@mail.candlish.net verify return:1 * OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE AUTH=PLAIN AUTH=LOGIN SASL-IR] dmz server ready A login <span style="color: #800000">someuser.mailbox@mail.candlish.net</span> ThePassword A OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE ACL RIGHTS=kxte QUOTA MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN MULTIAPPEND BINARY CATENATE CONDSTORE ESEARCH SORT SORT=MODSEQ SORT=DISPLAY THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE LIST-EXTENDED WITHIN QRESYNC SCAN XLIST URLAUTH URLAUTH=BINARY LOGINDISABLED AUTH=PLAIN AUTH=LOGIN COMPRESS=DEFLATE IDLE] User logged in SESSIONID= A list "" "*" * LIST (Noinferiors HasNoChildren) "/" INBOX * LIST (HasNoChildren) "/" Archive * LIST (HasChildren) "/" Bewerbung-2007 * LIST (HasNoChildren) "/" Bewerbung-2007/Received * LIST (HasNoChildren) "/" Bewerbung-2007/Sent * LIST (HasChildren) "/" Calendar * LIST (HasNoChildren) "/" "Calendar/Personal Calendar" * LIST (HasNoChildren) "/" Configuration * LIST (HasChildren) "/" Contacts * LIST (HasNoChildren) "/" "Contacts/Personal Contacts" * LIST (HasNoChildren) "/" Drafts * LIST (HasNoChildren) "/" Files * LIST (HasNoChildren) "/" Freebusy * LIST (HasNoChildren) "/" Journal * LIST (HasNoChildren) "/" Notes * LIST (HasNoChildren) "/" RC_Trash * LIST (HasNoChildren) "/" Sent * LIST (HasNoChildren) "/" Spam * LIST (HasNoChildren) "/" Tasks A OK Completed (0.002 secs 20 calls) A logout * BYE LOGOUT received A OK Completed read:errno=0 |