On 9/2/19 3:03 PM, Sami Ketola wrote:>> On 2 Sep 2019, at 15.25, Peter Mogensen via dovecot <dovecot at dovecot.org> wrote:...>> Is there anyway for dsync to avoid moving Gigabytes of data for could >> just be "moved" by moving the mount? > > > Not tested but you can probably do something like this in the target server: > > doveadm backup -u victim -R ssh sudouser at old-server "sudo doveadm dsync-server -o mail_location=sdbox:/location-to-your-sdbox/ -u victim" > > just leave ALT storage path from the setting.I'll have to test this... but my initial guess would be that doveadm would then think the mails has disappeared. Would it then copy the index metadata for those mails to the target host anyway? /Peter
> On 3 Sep 2019, at 15.34, Peter Mogensen via dovecot <dovecot at dovecot.org> wrote: > > > > On 9/2/19 3:03 PM, Sami Ketola wrote: >>> On 2 Sep 2019, at 15.25, Peter Mogensen via dovecot <dovecot at dovecot.org> wrote: > ... >>> Is there anyway for dsync to avoid moving Gigabytes of data for could >>> just be "moved" by moving the mount? >> >> >> Not tested but you can probably do something like this in the target server: >> >> doveadm backup -u victim -R ssh sudouser at old-server "sudo doveadm dsync-server -o mail_location=sdbox:/location-to-your-sdbox/ -u victim" >> >> just leave ALT storage path from the setting. > > > I'll have to test this... but my initial guess would be that doveadm > would then think the mails has disappeared. Would it then copy the index > metadata for those mails to the target host anyway?Hmm. That is true. It will probably not work after all then. Now I'm out of ideas how to do this efficiently. Sami
On 9/3/19 2:38 PM, Sami Ketola wrote:> > >> On 3 Sep 2019, at 15.34, Peter Mogensen via dovecot <dovecot at dovecot.org> wrote: >> >> >> >> On 9/2/19 3:03 PM, Sami Ketola wrote: >>>> On 2 Sep 2019, at 15.25, Peter Mogensen via dovecot <dovecot at dovecot.org> wrote: >> ... >>>> Is there anyway for dsync to avoid moving Gigabytes of data for could >>>> just be "moved" by moving the mount? >>> >>> >>> Not tested but you can probably do something like this in the target server: >>> >>> doveadm backup -u victim -R ssh sudouser at old-server "sudo doveadm dsync-server -o mail_location=sdbox:/location-to-your-sdbox/ -u victim" >>> >>> just leave ALT storage path from the setting. >> >> >> I'll have to test this... but my initial guess would be that doveadm >> would then think the mails has disappeared. Would it then copy the index >> metadata for those mails to the target host anyway? > > > Hmm. That is true. It will probably not work after all then. > > Now I'm out of ideas how to do this efficiently.I assume it won't even work to just premount the shared storage read-only on the target side, so the mails are already there. ... since I suppose the receiving dsync reserves the right to re-pack the m.* storage files? /Peter
So... I've done some testing. One method which seemed to work - at least for primitive cases - was to: * Mount the ALT storage on the destination. * Run "doveadm force-resync \*" on the destination. (putting all the mails in ALT storage into the dovecot.map.index) * Run dsync from source to destination. Of course... if there was some way to avoid step 2... /Peter