[Dovecot] Migrate from Maildir to mdbox

Odhiambo Washington odhiambo at gmail.com
Fri Dec 24 09:42:43 EET 2010

Looking at http://wiki2.dovecot.org/Migration/MailFormat, I do not see much
on how to do a migration from Maildir to mdbox. That page isn't quite
updated it looks.

I have several domains (virtual) with the following storage layout:


So the users have their mail stored as follows:


>From the wiki, I am told the steps to take are:

1. Set mail_location=mdbox:~/mdbox
2. Run "doveadm mirror -u username maildir:~/Maildir"

The instruction above confuses me because in my situation, I don't have a
"username" per se. dovecot-deliver knows how to figure out my usernames and
their mail_location settings. How do I derive my "username" when users are
virtual, stored in MySQL back end?

Again, the right command seems to rely on dsync, not "doveadm mirror".

I could manually get all the values for the users for each domain and run:

dysnc -u $u -o "mail_location=maildir:/var/spool/virtual/domain1/$u/Maildir"
mirror "mdbox:/var/spool/virtual/domain1/$u/mdbox"

This is so manual, especially because I have to (if I remember well) create
/var/spool/virtual/domain1/$u/mdbox (and have the permissions right) before
running dysnc.

Is there an easier way out, perhaps??

Best regards,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

More information about the dovecot mailing list