dsync and altpath on shared storage.

Peter Mogensen apm at one.com
Thu Sep 5 12:36:34 EEST 2019



On 9/4/19 2:12 PM, Peter Mogensen wrote:
> 
> 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...

So ... I have an idea.

Assuming users mail_location is:

mdbox:~/mdbox:ALT=/alt:INDEX=~/idx

And /alt is a shard mounted storage.

Then, it suspect the following steps would make dsync avoid transfering
mails on shared storage:

1) Create a rudimentary mdbox on the target side (just containing the
dbox-alt-root link)

2) Mount /alt on the target host

3) Copy all dovecot.index and dovecot.map.index in ~/idx from source to
target. That is: not the transaction (*.log) files or cache files.
I suppose this needs to be done under appropriate read locking.

4) doveadm sync -u source doveadm dsync-server -u target
  ... to get the rest of the mails in primary storage and all updates
sine the index files where snapshot.



It would be nice if there was a way to force dovecot*index.log files to
be snapshot to index files.

If the aim is not to sync two different accounts but to simply move one
account from one host to a new host where it doesn't exist in advance,
are there any caveats with this?

... apart from a few missing tools.

/Peter


More information about the dovecot mailing list