Backing up and Importing IMAP folders

Konstantin Khomoutov flatworm at users.sourceforge.net
Thu Oct 20 14:49:42 UTC 2016


On Thu, 20 Oct 2016 17:38:31 +0300 (EEST)
Aki Tuomi <aki.tuomi at dovecot.fi> wrote:

[...]
> > > > Alternatively you can use `dsync` to perform backup with a
> > > > native Dovecot tool.  It's able to sync mailboxes of any
> > > > Dovecot user -- including synchronizing a mailbox to an empty
> > > > (yet) spool. You'll need to do a bit of shell scripting which
> > > > would spin around calling `doveadm user *` and feeding its
> > > > output to something like
> > > > 
> > > >   while read user; do \
> > > >     dest="/var/backup/dovecot/$user";
> > > >     mkdir -p "$dest" && chown vmail:vmail "$dest" \
> > > >       && chmod 0755 "$dest"
> > > >     dsync -u "$user" backup "maildir:$dest" \
> > > >   done
> > > > 
> > > > Note that you will only need this if you don't want to shut down
> > > > Dovecot to copy its mail spool out.
> > > 
> > > You can also use doveadm backup -A maildir:%u/
> > 
> > Looks like `doveadm` of my Dovecot 2.2 (Debian 8.0 Jessie) does not
> > support the "backup" subcommand.  Is it a past-2.2 addition?
> 
> We aren't past 2.2 yet. But it should work with dsync -A backup as
> well I guess.

Oh, that's a documentation problem: the manual page doveadm(1) does not
mention the word "backup" at all while running the command actually
tells it's supported:

  $ doveadm backup -A
  doveadm backup [-u <user>|-A] [-S <socket_path>] [-dfR] [-l <secs>]
  [-r <rawlog path>] [-m <mailbox>] [-n <namespace> | -N] [-x <exclude>]
  [-s <state>] <dest>

Good to know, thanks!


More information about the dovecot mailing list