[Dovecot] backing up maildir dovecot files

Steve Litt slitt at troubleshooters.com
Mon Feb 11 23:37:41 EET 2013


On Mon, 11 Feb 2013 21:47:57 +0100
Reindl Harald <h.reindl at thelounge.net> wrote:

> 
> 
> Am 11.02.2013 21:34, schrieb David Mehler:
> > I'm having to migrate servers. Both are dovecot2 systems. I'm
> > wanting to copy over my mail store from one system to the other.
> > I'd like to preserve dates/times of emails. These are maildir
> > setups on both boxes, I'd like to be as transparent to the end user
> > as possible. I currently have the first dovecot system offline and
> > the second dovecot system is offline.
> 
> assuming that BOTH servers are down as fro any other transfers
> like mysql-datadirs and any critical things which should go
> save and fast by preserve attributes:
> 
> rsync --force --delete-after -tPrlHpogEAXz /folder/
> root at newserver:/folder/
> 
> # -z compress
> # -t timestamps
> # -P progress
> # -r recursive
> # -l links
> # -H hard-links
> # -p permissions
> # -o owner
> # -g group
> # -E executability
> # -A acls
> # -X xtended attributes

That's how I'd do it also. I think if you didn't mind including -D,
which from my understanding is --special and --devices, neither of
which I'd expect in a maildir, and if you wanted to do your deletion
manually after the fact, would this be equivalent?

rsync  -PaHAX /folder/

The man page says -a (--archive) is equivalent to -rlptgoD, and you
have all but D listed up there.

My thinking on later manually deleting the old maildir, instead of
letting rsync do it, is that if somehow, some weird thing goes wrong, I
have the old one for backup. Who knows, maybe I copied the thing on top
of the wrong other maildir and have to back it out -- I'd have the old
maildir as a reference of which files.

Of course there are arguments for instant deletion too, like the fact
that a person runs the risk of accidentally deleting the wrong one, or
the fact that a huge maildir folder could take hours to delete.

Personally, I never delete til I'm sure it got to the right place and
is backed up there, and sometimes I keep it on the old box for a month
"just in case" if the old box won't be used anymore.

SteveT



More information about the dovecot mailing list