Yeah, i guess the right ocmando would be dsync
dsync get the user from mysql, with user query. I guess.
Are you looking to do it without any downtime ?
Are you getting the mail_location from mysql or in conf file ?
I would use dsync backup. I had some trouble using mirror when a box was corrupted, it messed up both sides.
[]'sf.rique
On Fri, Dec 24, 2010 at 5:42 AM, Odhiambo Washington odhiambo@gmail.comwrote:
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:
/var/spool/virtual/$domain.
So the users have their mail stored as follows:
/var/spool/virtual/domain1/$user/Maildir /var/spool/virtual/domain2/$user/Maildir /var/spool/virtual/domain3/$user/Maildir /var/spool/virtual/domainN/$user/Maildir
From the wiki, I am told the steps to take are:
- Set mail_location=mdbox:~/mdbox
- 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, Odhiambo WASHINGTON, Nairobi,KE +254733744121/+254722743223
Damn!!