Migrate Dovecot mailboxes from one server to another?

Hi,

I have an old mail server running Oracle Linux 7 with Postfix and Dovecot. It’s a bone-headed configuration (Keep It Simple Stupid) with “classical” users, each one having a Maildir mailbox.

Here’s what this looks like for example :

# ls -lF /home/kikinovak/Maildir/
total 184
drwx------. 2 kikinovak kikinovak 32768 Jan 17 13:53 cur/
-rw-------. 1 kikinovak kikinovak  6464 Oct 14 00:07 dovecot.index
-rw-------. 1 kikinovak kikinovak 69316 Jan 17 13:53 dovecot.index.cache
-rw-------. 1 kikinovak kikinovak 14664 Jan 17 13:53 dovecot.index.log
-rw-------. 1 kikinovak kikinovak    30 May 15  2019 dovecot-keywords
-rw-------. 1 kikinovak kikinovak   648 Jun  3  2019 dovecot.mailbox.log
-rw-------. 1 kikinovak kikinovak 19559 Jan 17 13:53 dovecot-uidlist
-rw-------. 1 kikinovak kikinovak     8 Jun  3  2019 dovecot-uidvalidity
-r--r--r--. 1 kikinovak kikinovak     0 Jun 30  2017 dovecot-uidvalidity.59560d19
drwx------. 2 kikinovak kikinovak 16384 Jan 18 08:01 new/
-rw-------. 1 kikinovak kikinovak    54 Jun  3  2019 subscriptions
drwx------. 2 kikinovak kikinovak  4096 Jan 18 08:01 tmp/

Now I just installed a new mail server with Postfix and Dovecot on a different hardware using Rocky Linux 8. And I seem to have a bit of trouble migrating mails.

I though a simple rsync -av Maildir newmachine:/home/account/ would do the trick. But here’s what happens.

On the one hand, I can configure an account (with Thunderbird for example) and view all the existing emails.

On the other hand, mails sent to this account suddenly disappear in byte heaven. They don’t even show up in /var/log/maillog.

So what am I doing wrong here ?

https://doc.dovecot.org/admin_manual/migrating_mailboxes/

1 Like