I am trying to migrate a number of user mail accounts from dovecot 1.0.7 on a centos 5.11 server to dovecot 2.1.7 on a debian 7 server

Foolishly I thought I could simply replicate the Maildirs from one server to the other using rsync, change the dns and all would be fine.

Sadly that did not work.

While the process did seem to go well Thunderbird on my test account is insisting on re downloading ALL the mail as duplicate unread emails.

Is there a way I can import the mail from the source centos server to the destination debian server without forcing the user to potentially having to sort through and delete hundreds of duplicate emails?

I am using IMAP for the mail protocol

3 Answers 3


If you have configured server and created user accounts on debian. Then to migrate mails, you can use imapsync utility.

This utility just synchronizes mails between two servers. You don't need to worry about mail directory path/structure on both servers.

But you should know password for user account to transfer mails. Check imapsync use link for more information.

  • Thanks for the link to imapsync. unfortunately it fails from a major issue. you need to know all the users passwords. I don't, it is possible to setup dovecot with a master password to solve this issue though. Commented Aug 23, 2015 at 2:37
  • @DeveloperChris I don't think you can use any master password to do this. You have to set default password for users and then migrate mails. After migrating, you can use old passwd file to restore passwords. Check answers from below link (serverfault.com/questions/357053/…)
    – AVJ
    Commented Aug 23, 2015 at 9:54
  • Good point. I didn't think about using an alternative password file. Commented Aug 24, 2015 at 1:10

Can you specify the rsync command that you used as if I'm not mistaken you need to make sure the modification timestamps are preserved when doing the rsync. A quick look at man rsync tells me that rsync should have the options like -tPrlHpogEAXz when you run it.

  • Thanks. you are partially correct. you prompted me to re look at my rsync command and I found a major gotcha! I had left out --delete. Commented Aug 23, 2015 at 2:38

I have solved the issue.

I have been meaning to do this move for a few months. in that time I have been rsyncing all users folders to the new server.

I forgot to add the --delete command to the rsync command thus old email messages were accumulating on the destination (new) server even after the user had deleted them from the old server.

Therefore when I switched to the new server dovecot automatically indexed the extra emails and the clients dutifully picked them up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .