Migrating maildirs - Courier to Dovecot

Stroller stroller at stellar.eclipse.co.uk
Thu Sep 21 21:34:47 EEST 2017


I apologise, because I'm sure this subject has been done to death, but I want to migrate from Courier to Dovecot.

I think my main question is whether there's any reason I shouldn't just rsync the maildirs across from the old mail server to the new one? 

There aren't many clients using this server, so I don't care if clients have to redownload all their messages (in fact, I expect they'll probably end up doing so anyway).

I'd like to preserve read/unread status of each message, but can't think of anything else important.

It doesn't matter if there's a few hours of downtime, but I thought to use rsync because I figured I copy the maildirs a day or two ahead of time, and then a sync immediately before going live will be quicker.

Using imapsync [1] looks pretty good, and I'm happy to use that if it'll be "cleaner" or help Dovecot to create its hierarchy more neatly.

It looks like Courier creates a courierimapuiddb, courierimapkeywords and courierimapacl in each folder - can I not just delete these, and hand Dovecot a bunch of maildir directories and files to reindex for itself?

There are probably only a few hundred thousand messages on the server, a few GB worth, although some of them are many years old.

Some of the messages on the old server have the wrong "received" date on them, having the wrong file creation / modification date on the server's filesystem, having been copied there previously (years ago) without using cp's --archive flag. I've always thought I should one day write a script to fix this, perhaps using mboxgrep.

Thanks in advance for any of your thoughts,

Stroller.





[1] https://wiki2.dovecot.org/Migration#IMAP_.3C-.3E_IMAP_copying


More information about the dovecot mailing list