Unable to find a decent tutorial on this and the dovecot wiki doesn't seem to specify much other than the command line parameters for doveadm sync.

I need to move emails from a hosting provider to a new server I've set-up (time-bound on this before the old hosting provider charges for another year). The new server has been set-up with postfix and dovecot. These have been configured in the following manner.

Dovecot does authentication
Dovecot file holds users and passwords
2 x domains set-up (example.com and example2.com)

This set-up works for inbound and outbound for example.com and example2.com.

Old hosting provider with domain oldexample.com holds several mailboxes to be migrated. While I can access the server via SSH it is extremely locked down so no root access or even access to install anything. If I've understood correctly I can use dovecot on the new email server to pull the accounts using the dsync utility via IMAP.

The questions I have (before I start) are

  1. Do I need to create the users from oldexample.com on the new server before I attempt the sync?
  2. Do I need to add the domain oldexample.com to the new server config before or after I attempt the sync?
  3. When should the MX records etc for oldexample.com be updated - presumably after the sync?

Any help appreciated or if there is a tutorial out there with this information (and any other relvant info) that I've missed please point me in that direction.


After a bit of playing around I managed to figure it out - details below for anyone who comes across this (presuming your postfix and dovecot is set-up as detailed above - which was setup as per https://www.binarytides.com/install-postfix-dovecot-debian/).

  1. Add the domain to be migrated to /etc/postfix/virtual_mailbox_domains
  2. Add the users to be migrated to the user auth file (/etc/dovecot/dovecot-users)
  3. Add migration config to /etc/dovecot/conf.d/migrate.conf (taken from https://wiki2.dovecot.org/Migration/Dsync)
  4. For each user run the below command (updating the username)
    doveadm -D -v -o mail_fsync=never backup -R -u user@oldexample.com imapc:
  1. Update DNS/MX records

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.