At a customer we run dovecot-2.3.10 along with postfix and mariadb, using postfixadmin as GUI. Now I plan to migrate to a new hardware (bigger machine) and in the same step to migrate from Gentoo Linux to Debian Linux. So I think about how to get the mailboxes from A to B. We use one UID afaik: mail_home = /home/vmail/%d/%u mail_location = maildir:~ I read about dsync and wonder: * does it make sense in this case to set up replication and let the servers replicate at first while still running on the old server? * do I have advantages over doing some rsync-jobs? * I somewhere read about not being able to sync sieve-scripts below the maildirs? We have: plugin { sieve = /home/vmail/%d/%u/sieve/.dovecot.sieve sieve_before = /etc/dovecot/sieve/global/default.sieve sieve_dir = /home/vmail/%d/%u/sieve/scripts/ sieve_extensions = +imapflags } * would the replication sync over all the existing mails/mailboxes or only the ones created *after* starting the replication? Stupid question maybe, but I just want to be sure before I screw up the installation. - sure, backups backups all the way ;-) thanks for any feedback on this! Stefan
* Stefan G. Weichinger:> does it make sense in this case to set up replication and let the > servers replicate at first while still running on the old server?If you use "dsync over TCP connections" [1], you can set up your new server without users noticing it (with the exception of extra server load for replication). It will take some time to sync all the data, but it takes no manual action once replication is fully set up. [1] https://wiki.dovecot.org/Replication The docs state one should be able to use a "noreplicate" field to limit the accounts, but I was not able to get it to work with a LDAP user DB. Regardless what value I provided in LDAP, replication would happen, and I could not find detailed documentation.> do I have advantages over doing some rsync-jobs?Oh, you know, some small stuff, like data integrity checks, retry on failures, event-driven replication. ;-) -Ralph
Am 15.04.20 um 20:36 schrieb Ralph Seichter:> * Stefan G. Weichinger: > >> does it make sense in this case to set up replication and let the >> servers replicate at first while still running on the old server? > > If you use "dsync over TCP connections" [1], you can set up your new > server without users noticing it (with the exception of extra server > load for replication). It will take some time to sync all the data, but > it takes no manual action once replication is fully set up. > > [1] https://wiki.dovecot.org/Replication > > The docs state one should be able to use a "noreplicate" field to limit > the accounts, but I was not able to get it to work with a LDAP user DB. > Regardless what value I provided in LDAP, replication would happen, and > I could not find detailed documentation. > >> do I have advantages over doing some rsync-jobs? > > Oh, you know, some small stuff, like data integrity checks, retry on > failures, event-driven replication. ;-)Ah, sure, nice ;-) I have the config ready on the "old" server, so we're waiting for the new box to be delivered. As always with new sync tools I am cautious to not lose data by doing something wrong (like syncing the empty server to the productive one ;-) ). As far as I see that can't happen here ... For sure I already read [1] ... and I have this block prepared now (as far as I understand I need all of this): ## 2020-04 replication, @sgw # mail_plugins = $mail_plugins notify replication service aggregator { fifo_listener replication-notify-fifo { user = vmail mode = 0666 } unix_listener replication-notify { user = vmail mode = 0666 } } service config { unix_listener config { user = vmail } } service replicator { unix_listener replicator-doveadm { mode = 0666 } } service doveadm { inet_listener { port = 12345 } } doveadm_port = 12345 doveadm_password = aadCdsfxxxx plugin { mail_replica = tcp:anotherhost.example.com:12345 # use port 12345 explicitly } -- at least it didn't throw errors at a first test ;-) (dry run)
On 15 Apr 2020, at 07:50, Stefan G. Weichinger <lists at xunil.at> wrote:> So I think about how to get the mailboxes from A to B. > > We use one UID afaik: > > mail_home = /home/vmail/%d/%u > mail_location = maildir:~ > > I read about dsync and wonder: > > * does it make sense in this case to set up replication and let the > servers replicate at first while still running on the old server?I ave done this (dovevot mailers under a email user) and I simply used rsync to copy the mail to the new machine. Once I had synced, I then synced again, shutdown the mail server, synced on last time, and started the mail server on the new hardware. The last sync only had to catch up a few emails, so all told I was down for a shorter time than a simple reboot. That said, doing it via replication would have been ?better? but in my case wasn?t worth the time it would have taken to setup, test, test, backup all the mail an extra time anyway, and then implement. I?m about to do it all over again since old machine running the Mailserver cannot seem to boot properly to install FreeNSD amd64 despite being a 64bit Intel (It?s a BIOS/EFI issue), so I am dropping in a new, albeit still old, replacement with a zpool of three SSD drives (up from the current setup of 2 SSDs with backups on the second drive and on a second machine and on a remote machine) ?
On 16 Apr 2020, at 19:37, @lbutlr <kremels at kreme.com> wrote:> (dovevot mailers under a email user)vmail user, thank you autocorrect. -- "Are you pondering what I'm pondering?" "I think so, Larry, and um, Brain, but how can we get seven dwarves to shave their legs??
Am 17.04.20 um 03:37 schrieb @lbutlr:> On 15 Apr 2020, at 07:50, Stefan G. Weichinger <lists at xunil.at> > wrote: >> So I think about how to get the mailboxes from A to B. >> >> We use one UID afaik: >> >> mail_home = /home/vmail/%d/%u mail_location = maildir:~ >> >> I read about dsync and wonder: >> >> * does it make sense in this case to set up replication and let >> the servers replicate at first while still running on the old >> server? > > I ave done this (dovevot mailers under a email user) and I simply > used rsync to copy the mail to the new machine. > > Once I had synced, I then synced again, shutdown the mail server, > synced on last time, and started the mail server on the new hardware. > The last sync only had to catch up a few emails, so all told I was > down for a shorter time than a simple reboot. > > That said, doing it via replication would have been ?better? but in > my case wasn?t worth the time it would have taken to setup, test, > test, backup all the mail an extra time anyway, and then implement.thanks for that feedback Today I will setup the new server and try to enable replication. I will connect both dovecots to the same instance of mariadb which should let them know about all the existing mailboxes ... and then I will see. My question around the sieve-scripts is still open ... I assume I will maybe try to replicate a sub-set of the mailboxes, check things ... and then decide how to proceed.