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?
On 2016-10-24 8:00, Gandalf Corvotempesta wrote:> 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?When I am doing this I just turn off both servers for the third sync. Its short enough to not cause much problem. And then after third sync I start the new server and all clients can connect to it so I also mitigate any problems resulting from clients that would be still connected to the old server. The last issue depends on the way you force everyone to use new server (DNS, routing, etc). Remember that beside the new emails that could arrive during sync you have also all sorts of user-generated operations as move, delete etc. So if you just do 3rd rsync without --delete you can end up duplicating users' emails if they move them during procedure. Best, Karol
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
2016-10-24 11:23 GMT+02:00 Karol Augustin <karol at augustin.pl>:> When I am doing this I just turn off both servers for the third sync. > Its short enough to not cause much problem. And then after third sync I > start the new server and all clients can connect to it so I also > mitigate any problems resulting from clients that would be still > connected to the old server. The last issue depends on the way you force > everyone to use new server (DNS, routing, etc).The speed for third sync depends on the number of files to be scanned. I have mailboxes with tons of very small emails, thus even if the first two sync has transferred all datas, the scan made by rsync to check which files needs to be transferred requires many hours. My own mailbox has 80GB of mails. I can sync everything on a new server and then start a new rsync phase. this new phase requires exactly 1 hours and 49 minutes (as I can see from the last night backup). Transferred data: 78MB. 1 hours and 49 minutes to transfer only 78MB.> Remember that beside the new emails that could arrive during sync you > have also all sorts of user-generated operations as move, delete etc. So > if you just do 3rd rsync without --delete you can end up duplicating > users' emails if they move them during procedure.By shutting down both servers, the "--delete" argument could be used with no issues.
2016-10-24 14:47 GMT+02:00 Michael Seevogel <ms at ddnetservice.de>:> 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.Are you talking about the new server or the older one that I have to replace? The new server has to be installed from scratch, so, yes, I can use Dovecot 2.2 from Jessie The "old" server is based on Squeeze, I can upgrade that to Wheezy and install Dovecot 2.2 from wheezy-backports but I have huge trouble when I've tried to do the same on a similiar server. I was unable to upgrade the dovecot configuration by following the documentation as this didn't work: doveconf -n -c /etc/dovecot/dovecot.conf > dovecot-2.conf I had an empty dovecot-2.conf file, no warning or output at all. It did nothing.> 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.Cool. Any guide about this ? Should I start the replication on one side and wait for finish before pointing the mailbox to the new server?> 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.I can't block the whole server. I have to migrate 1 user at once. But I can disable the pop3/imap access for that user, so noone is changing the files during the migration (except for the postfix/exim delivery agent)> 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/DsyncThank you
2016-10-24 14:47 GMT+02:00 Michael Seevogel <ms at ddnetservice.de>:> 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...No, I don't like that format, for this: This also means that you must not lose the dbox index files, they can't be regenerated without data loss additionally, this means to change even our LDA, as neither Exim or Postfix are able to deliver messages.