doveadm-backup - Dovecot\(aqs one-way mailbox synchronization utility
------------------------------------------------------------------------
doveadm " [" -Dv "] " backup [-u user|-A|-F file]
[-S socket_path]
[ -fPRU ] [-l secs]
[-r rawlog_path]
[-m mailbox]
[-g mailbox_guid]
[-n namespace|-N]
[-x exclude]
[-s state]
[-T secs]
[-t start date]
[-e end date]
-d|destination
------------------------------------------------------------------------
You can run dsync in one of three modes:
-------------------------------------
There are also three different synchronization algorithms:
-------------------------------------
The syncing is done as perfectly as possible: an IMAP or a POP3 client shouldn\(aqt be able to notice any differences between the two mailboxes. Two-way syncing means that it\(aqs safe to do any kind of modifications in both sides, and dsync will merge the changes without losing any changes done on either side. This is possible because dsync can access Dovecot\(aqs index logs that keep track of changes. It\(aqs of course possible to have conflicts during merging, these are resolved in a safe way. See the dsync design document for more information.
dsync uses the same configuration files as the rest of Dovecot (via doveconf (1) binary). The entire configuration can be changed by giving -c parameter to another configuration file, or using -o parameter to override specific settings. When executing a remote dsync program it works the same way: it uses its own local configuration.
dsync can be run completely standalone. It doesn\(aqt require any Dovecot server processes to be running, except when using -u parameter to do a userdb lookup from auth process.
dsync can sync either one or multiple users using the -u or -A
parameters.
For continuous replication you can use the Dovecot replicator process,
which automatically runs dsync whenever messages have changed.
------------------------------------------------------------------------
@INCLUDE:global-options@
--- command specific options --- "/.
Command specific options :
-1 Do one-way synchronization instead of two-way synchronization.
-------------------------------------
@INCLUDE:option-A@
-------------------------------------
@INCLUDE:option-F-file@
-------------------------------------
-N Synchronize all the available namespaces.
By default only namespaces that don\(aqt have explicit location setting
are synchronized.
-------------------------------------
-P Run a
doveadm-purge (1) for the destination (remote) storage after synchronization.
-------------------------------------
-R Do a reverse sync. Normally, messages would be pushed from the local
system to the destination (remote). This option reverses the flow, and
will instead pull messages from the remote to the local storage.
-------------------------------------
@INCLUDE:option-S-socket@
-------------------------------------
-T secs Specify the time in seconds, how long
doveadm (1) should wait for stalled I/O operations.
The default timeout is 600 seconds.
-------------------------------------
-U This is used internally by replicator to have dsync notify it when the
synchronization is finished.
-------------------------------------
-d Use the default destination, which is looked up from the
mail_replica userdb extra field.
-------------------------------------
-g mailbox_guid Same as -m, but find the mailbox to be synchronized by its GUID instead
of by name.
-------------------------------------
-l secs Lock the dsync for this user.
Wait for maximum
secs before giving up.
This parameter should be used to avoid broken synchronization if it\(aqs
possible that dsync is being run concurrently for the same user.
-------------------------------------
-m mailbox Synchronize only this mailbox name.
-------------------------------------
-n namespace Synchronize only the specified namespace.
This parameter can be used multiple times.
-------------------------------------
-r rawlog_path Running dsync remotely, write the remote input/output traffic to the
specified log file.
-------------------------------------
-s previous_state Use stateful synchronization.
If the previous state is unknown, use an empty string.
The new state is always printed to standard output.
-------------------------------------
@INCLUDE:option-u-user@
-------------------------------------
-x mailbox_mask Exclude the specified mailbox name/mask.
The mask may contain \(dq?\(dq and \(dq*\(dq wildcards.
This parameter can be used multiple times.
------------------------------------------------------------------------
destination This argument specifies the synchronized destination. It can be one of:
location Same as mail_location setting, e.g. maildir:\(ti/Maildir
remote: login@host Uses dsync_remote_cmd setting to connect to the remote host (usually via ssh)
remoteprefix:login@host This is the same as remote, except \(dquser@domain\(rsn\(dq is sent before dsync protocol starts. This allows implementing a trusted wrapper script that runs doveadm dsync-server by reading the username from the first line.
tcp: host[:port] Connects to remote doveadm server via TCP. The default port is specified by doveadm_port " setting."
tcps: host[:port] This is the same as tcp, but with SSL.
4 0 Synchronization was done perfectly.
2 Synchronization was done without errors, but some changes couldn\(aqt be done, so the mailboxes aren\(aqt perfectly synchronized. Running dsync again usually fixes this. Typically this occurs for message modification sequences with newly created mailboxes. It can also occur if one of the mailboxes change during the syncing.
1, >2 Synchronization failed.
------------------------------------------------------------------------
doveadm sync -u username@example.com remote:server-replica.example.com
If you need more complex parameters to ssh, you can use e.g.:
doveadm sync -u username@example.com ssh -i id_dsa.dovecot \(rs mailuser@example.com doveadm dsync-server -u username@example.com
If you want to do this without any downtime, you can do the conversion one user at a time. Initially:
Then for each user:
Once all users have been converted, you can set the default
mail_location to mdbox and remove the per-user mail locations from
userdb . ------------------------------------------------------------------------
@INCLUDE:reporting-bugs@
------------------------------------------------------------------------
Additional resources: