[Dovecot] repeating dsync - questions
Bob Gustafson
bobgus at rcn.com
Mon Apr 8 00:10:20 EEST 2013
On Sun, 2013-04-07 at 20:50 +0300, Timo Sirainen wrote:
> On 7.4.2013, at 17.12, Bob Gustafson <bobgus at rcn.com> wrote:
>
> > I am still on my quest for a quick way to move mail from a live Maildir
> > system to a 'soon to be live' sdbox system.
> >
> > I copy Maildir to new system using:
> > rsync -ar --times hoho4:/home/bobgus/Maildir/ /home/bobgus/Maildir
> >
> > Then I convert from Maildir to sdbox with:
> > dsync mirror maildir:~/Maildir
> >
> > Then I copy more messages from live system using rsync
>
> ^^ that is the mistake
I guess I have a basic misunderstanding of what 'dsync mirror' is doing.
My understanding is that going from Maildir to sdbox, dsync does not
mess with the data in Maildir. The Maildir metadata is in one form and
the sdbox metadata is in another form (in the sdbox directory).
No new email messages enter the sdbox system to be 'mirrored' to the
Maildir system.
I thought of using the 'dsync backup' command, but the sentence "Any
changes done in destination are discarded." seems to indicate that each
time 'dsync backup' is done, it starts from the beginning. No
incremental backup (but this is done in 2.2 ?)
>
> > Then I do the 'dsync mirror maildir:~/Maildir' again
> >
> > There were only a few messages that were copied over in the 2nd rsync
> > pass and it went quickly, but the 2nd dsync pass is taking a long time.
>
> The second rsync is overwriting all the metadata changes (mailbox GUIDs
> most importantly) that the first dsync run did.
Why does dsync mess with the Maildir metadata? Won't that just confuse
the dovecot running on the Maildir system?
>
> > Also, I see strange directories in the sdbox directory (see below)
>
> Also caused by the same thing.
>
> v2.2 dsync should be able to handle this much better, but in general
> you shouldn't be mixing rsync and dsync in that way. You could for
> example install Dovecot v2.1 dsync to the source server (could even be
> under /tmp by compiling from sources) and then do the conversion
> directly from source server maildir to destination server sdbox.
>
I used rsync because I really don't want the source system messed with.
This has been a learning experience with the possibility (and reality)
of starting over on the destination system by doing 'rm -rf Maildir' and
'rm -rf sdbox'.
Until I figure it all out, I want that option.
This also means that the 2nd (and nth) spin of (rsync; dsync) needs to
take less time, approaching the mean time between emails (although I can
disconnect from ISP to do the last batch and then switch dovecots)
More information about the dovecot
mailing list