Moving dovecot/maildir to new host, dovecot.* files

John Gateley dovecot at jfoo.net
Fri May 26 17:02:58 EEST 2017


Thank you Bill,

John

May 24, 2017 1:27 PM, "Bill Shirley" <bill at knoxvillechristian.org> wrote:
> I did it successfully the way you're thinking about doing it.
> 
> If your uid's changed you should use rsync's --usermap= and --groupmap=
> I created a bash exec with an entry for each user:
> #!/usr/bin/bash
> 
> USERMAP=400:psql,301:smbguest,501:bill
> GROUPMAP=400:pvsw,401:pvsw-adm,301:smbguest,501:bill
> 
> echo smbguest
> # begin single looong line
> rsync -Aaxlrt --delete -e 'ssh -p 20026' --bwlimit=50m --numeric-ids --usermap=$USERMAP
> --groupmap=$GROUPMAP --exclude '*~' --exclude 'dovecot*' --exclude 'maildir.dovecot.purge.conf'
> rsync://192.168.40.231/home/smbguest/Maildir/ /home/smbguest/Maildir/
> # end single line
> 
> mv /home/smbguest/Maildir/current.sieve /home/smbguest/Maildir/dovecot.sieve
> mv /home/smbguest/Maildir/current.svbin /home/smbguest/Maildir/dovecot.svbin
> 
> echo bill
> .
> .
> 
> Note I changed my sieve file name on the new server.
> USERMAP consists of comma separated pairs of old_server_uid:new_server_username
> likewise with GROUPMAP and gid and group_name
> maildir.dovecot.purge.conf is a file I use to purge user folders
> 
> Bill
> 
> On 5/24/2017 10:31 AM, John Gateley wrote:
> 
>> Hello,
>> 
>> I've done a fair amount of searching, and couldn't find a definitive answer.
>> 
>> I am moving my dovecot/postfix servers and mail in Maildir formats to a new host.
>> When I move the Maildir directories, what should I do with the dovecot.index/cache/log/etc. files?
>> I know I can filter them out, and dovecot will recreate them, but is that the best approach?
>> 
>> I am thinking of the following:
>> Shut down postfix and dovecot on both the new and old server
>> rsync the maildirs from the old server to the new server
>> start up postfix/dovecot on the new server
>> verify all is okay
>> switch DNS from old server to new server.
>> 
>> Is this the best approach with minimal impact to mail users?
>> 
>> Thanks very much
>> 
>> John


More information about the dovecot mailing list