Server migration

Michael Seevogel ms at ddnetservice.de
Mon Oct 24 12:47:03 UTC 2016


Am 24.10.2016 um 09:00 schrieb Gandalf Corvotempesta:
> Hi
> i have to migrate, online, a dovecot 1.2.15 to a new server. Which is the
> best way to accomplish this?
>
> I have 2 possibility:
> 1) migrate from the very old server to a newer server with the same dovecot
> version
> 2) migrate from the very old server to a new server with the latest dovecot
> version
>
> can i simply use rsync to sync everything and, when the sync is quick, move
> the mailbox from the old server to the new server? My biggest concern is
> how to manage the the emails that are coming during the server switch.
>
> Let's assume a 50gb maildir , the first sync would require hours to
> complete (tons of very small files) do i can't shutdown the mailbox. The
> second sync would require much less time and would also sync the email
> received during the first sync (but the mailbox is still receiving new
> emails)
> now, as third phase, i can move the mailbox to the new server (by changing
> the postfix configuration) so that all new emails are received on the new
> server and then start the last rsync (by removing the --delete flag or any
> new emails would be deleted as not existsnt on the older server)
>
> Any better solution?
>


If your server OS supports newer Dovecot versions then I would highly 
suggest you to upgrade to Dovecot 2.2.xx (or at least to the latest 2.1) 
and set up Dovecot's replication[1] feature.

With this method you can actually archieve a smooth migration while your 
current server replicates all emails in real time to your new server, 
including new incoming emails and also mailbox changes to your new 
server and when the migration is done you'll just have to change your 
DNS and disable the Replication service.

If you don't want or cannot set up replication you could still do a 
one-shot migration via Dovecot's dsync[2] on the new server, pulling the 
mails from the old. 50GB isn't that much as long as your two servers are 
at least connected with 100 Mbit to the inet. You may want to block for 
the time of the migration via iptables your users accessing Dovecot. 
However, under the bottom-line, if this is really necessary depends on 
you and the needs of your mailusers/customers.



Best regards
Michael Seevogel

P.S. You should think about to use on the new server mdbox as mailbox 
format.
That's kinda a hybrid of mbox and maildir and benefits of features of 
both its predecessors. However, backup and restoring is in case of mdbox 
"a bit" different. Just have a read...


[1] http://wiki.dovecot.org/Replication
[2] http://wiki2.dovecot.org/Migration/Dsync


More information about the dovecot mailing list