My need at the moment is only a *one* time deal.
I just need to copy/convert all of the messages over to the new system and new (sdbox) format *once*. Then all of the clients can start from zero to build their caches based on the new mail box (not that many clients).
I will take a look at the Imap copy process - maybe that would be simpler in the long run. No rsync needed (as long as the source system is not changed by the Imap copy process)
Thanks much for your comments and suggestions
Bob G
On Mon, 2013-04-08 at 13:57 +0300, Timo Sirainen wrote:
On 8.4.2013, at 1.32, Bob Gustafson bobgus@rcn.com wrote:
Ok, how is this for a scheme:
- Initially rsync Maildir to destination system
- Do initial 'dsync backup' from Maildir to sdbox on destination system
- Do a 2nd rsync of new Maildir data from live system to destination system, but don't copy the old maildir-uidlist still in the Maildir of the live system. rsync -ar --times --exclude=dovecot-uidlist <live sys Maildir> <dest system Maildir>
I could also use the --ignore-existing option
In theory, rsync would not touch the dovecot-uidlist file, would not touch the existing message files, but would copy over the new messages received during the time 'dsync backup' was doing its previous run.
- Do a 2nd 'dsync backup' from the Maildir to the sdbox (which hasn't changed since the 1st 'dsync backup')
Without rsync --delete you may end up with duplicates if message flags had changed during it.
There's also another potential problem. Since you don't now update the dovecot-uidlist, the message UIDs may change. Some clients cache messages by their UID. These clients may lose messages or show wrong messages to users. So for example if:
- rsync + dsync is run to sdbox. dovecot-uidlist now says that next_uid=123
- Maildir receives mail A that gets assigned UID 123
- Maildir receives mail B that gets assigned UID 124
- User deletes mail A
- rsync is run, which copies the new mail B
- dsync is run, which notices a new mail B, and assigns it the a new UID 123
- You switch user to new Dovecot
- dbox receives a new mail C, and gets assigned UID 124
- User's client is now pretty much completely confused about what UIDs 123 and 124 contain. User may see different mails as subject and body. User may not even see the mail B anymore without a client cache rebuild.
Yet another possibility would be to use dsync to migrate the mails using IMAP protocol rather than from Maildir directly: http://wiki2.dovecot.org/Migration/Dsync