I like imapsync too, and have used it before, but there are a couple of problems. First of all you have to know the passwords of all accounts (or set up dovecot with a super user). Secondly it doesn’t ever quite get the IMAP / POP indexes right, so that when people connect to the new server, they end up re-downloading a bunch of emails.
So I’ve been thinking through an alternative approach. First of all, set up the mail domain on the new server with all the correct accounts, forwards, etc. And then use doveadm sync over ssh to sync a list of email addresses. This allows you to sync without passwords (using root or sudo), and will take care of all the dovecot indexing for you.
I have the sync command working for one test user. I’m now thinking about copying the settings over. Would this approach work?
- Locate the mail domain in $HESTIA/data/users/username/mail.conf and copy the entry to the new server.
- Copy the config files from /home/username/conf/mail/domain.com/ from the old server to the new one
- Run v-rebuild-mail-domain username domain.com
Would that transfer all the mail accounts over?
Then it would just be a case of generating a list of mail users and feeding them to my doveadm sync command.
Afterwards, I guess, set up SSL certs, DNS.
Does that seem like it might work? Anything I missed?