Migrate maildir mailboxes for Cyrus-Imap

The migration of maildirs managed by cyrus-imap is delicate because the cyrus.* files must be recreated correctly. Otherwise, cyrus completely ignores the mailboxes. The technique is to copy the mailboxes in the mail directory (the one defined in partition-default in imapd.conf) and rebuild cyrus.* files via cyradm. Follow the guide:

Stop cyrus-imap et log on the console

# /etc/init.d/cyrus-2.2 stop
# cyradm --user cyrus localhost
IMAP Password: <yourpassword>

Recreate the mailboxes manually

This doesn't erase the content of the folders on the harddrive, it only declares the mailboxes in cyrus engine.

localhost> cm user.machin
localhost> cm user.truc
localhost> cm user.bidule

Repair the metadata of all the mailboxes

The reconstruct command must be launch by cyrus user. Use su command as follow:

# su - cyrus -s /bin/sh -c 'for i in machin truc bidule; do /usr/lib/cyrus/bin/reconstruct -rkf user.$i;done'

All the mailboxes should be recreated properly. Restart your cyrus-imap server and try to connect with any of the user.

en/ressources/dossiers/cyrus/migrate_maiboxes.txt · Last modified: 2011/03/16 01:30 (external edit)
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0