User Tools

Site Tools


en:ressources:dossiers:cyrus:migrate_maiboxes

Migrate maildir mailboxes for Cyrus-Imap

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'
user.machin
user.machin.pouet
user.machin.choupinou
user.machin.caribou
user.truc
user.truc.important
user.truc.tresimportant
user.truc.photosdemafemme
user.bidule
........

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: 2024/04/17 10:19 by 127.0.0.1