How to move clients email accounts (or your own) from one server to another with no lost mail

The most important thing which you must know before starting the move is whether the mail account to be moved is POP or IMAP.

If the account is POP, your task is fairly straightforward.

You want to make sure that you move any unread move (mail from between the time your client last collected email and the time of the move is picked up and put on the new mail server). The best way to do that is to log into the old mail server and the new mail server via IMAP simultaneously. You will see what has been read and what hasn't. Just move the unread messages.

If you move the read messages, when your client logs in again via POP, he or she will have to sort through a 1000 or even 3000 archived messages in the inbox. Not fun.

We recommend using Apple Mail as the IMAP client as it's very easy and quick to set up. Windows Live Mail hides the IMAP accounts and folders and is ugly as sin. Thunderbird is very fiddly and exposes too many options but could do in a pinch or if you don't have a Mac handy.

After the move, there may also be a small lag while your client is only seeing the old server for reasons of DNS cache and won't get his or her new mail. For that reason, it's better to shut down the old mail server immediately after transferring the mail so he/she can't be picking up mail from both places at once.

For that reason I recommend doing the move at night at 3 in the morning, as your client has probably turned off his or her computer so the DNS will be renewed in the morning. If not, you'll have to ask them to flush their DNS cache (it's easy enough via GUI without IPconfig: turn on and off networking in the network control panel in Windows, Macs will flush the DNS automatically by switching network configurations). In the case, that even that is too technical, a restart will do the trick.

For a truly seamless move, it's essential that your host is using a modern convention for the mail login and smtp. All of our good hosts are using for POP, IMAP and SMTP. You will probably also be so lucky. If that's not the case, then you definitely have to involve the client in the move so that they will have the new login information.

At Foliovision, we proceed on the principle that our clients don't want to know about the IT unless they absolutely have to. They have work to take care of. It's up to us to sweat the details. And when we say sweat, we mean it. Ideally, they'd never notice that anything ever was changed or went wrong.

In principle, after moving from one host to another you should change all your passwords (the old ones are compromised from the previous host). In practice, I recommend keeping the passwords the same initially so that all of a client's automated logins will keep working. One doesn't want to be troubleshooting passwords and account moves simultaneously. As long as the passwords are the same, the move should be seamless.

Of course in most cases your clients will have to authorise the new server for email. Most will do so as a matter of course. (Get asked enough about security, you stop caring.)

If your client is already using IMAP, your task becomes much more sophisticated. If he or she is just using the standard IMAP mailboxes (Junk, Sent, Trash), your life is pretty simple. In this case, you simply move the contents of each mailbox (including Inbox) to the new account. When your client logs in, the messages will match and he/she will carry on work as before.

If your client has a sophisticated server side nest of mailboxes, you have a lot more work in front of you. First you have to duplicate the mailbox structure by hand and then drag the contents of each mailboxes over by hand. Dragging and dropping whole mailboxes won't work (at least in Apple Mail), as they are made into subfolders of the inbox.

In that case, you can look at zipping up the maildir folders, moving them over and resetting permissions. That leaves you no guarantee that the accounts are working properly. So if it's not a high volume mail move, I recommend a move by hand to be sure everything is working properly before you leave the job.

Here's some gotchas to look out for with a mail moves. Basically, POP ignores IMAP's read and unread flags.

  • For IMAP moves, careful not to touch unread mail on the server as the client may never see it (his/her email client will ignore read mail)
  • when POP picks up mail, they are marked as read in IMAP (bad).
  • if mail is marked as read in IMAP, it still gets downloaded via POP as unread (bad).


First check the mail server logs to see which clients log in via POP and which login via IMAP. It's all there in black and white with usernames. You need root access for this or submit a support ticket for shared hosting.

Here's the step by step guide for POP moves:

  1. set up new mail account on new server
  2. set up IMAP account for old account in Apple Mail
  3. set up IMAP account for new account in Apple Mail
  4. drag only the unread contents to the new account
  5. archive the old account for a few days (by disabling the mailbox: don't forget to delete all these accounts within a week for privacy reasons)

Here's the step by step guide for IMAP moves:

  1. set up new mail account on new server
  2. set up IMAP account for old account in Apple Mail
  3. set up IMAP account for new account in Apple Mail
  4. recreate the mailbox structure of the existing IMAP account
  5. drag all the contents to the new mailboxes one by one
  6. archive the old account for a few days (by disabling the mailbox: don't forget to delete all these accounts within a week for privacy reasons)


This entry was posted in IT. Bookmark the permalink.

8 Responses to How to move clients email accounts (or your own) from one server to another with no lost mail

  1. James Goulding

    Thanks for a brilliant article, although is there a way to connect to the new mailserver before the DNS transfer is complete?

  2. Giri Fox

    Thanks, I was wondering about how to do this for an SMTP (IMAP) user and your simple method should do the trick.

  3. Stephen Outram

    Great article. Thanks.
    I was wondering about shifting mail from an existing POP account on one mailserver, to an IMap account on another server (Macintosh). We are shifting to Microsoft Exchange Server and Mac Outlook; previously using MacMail.

  4. Hi Stephen,

    IMAP and Exchange are different products. We don’t like Exchange or anything Microsoft so we won’t be able to help you with that transition.


    PS. Microsoft privatizing email is not something I would ever want to support.

  5. Luna

    Hello Alec. I have a question for you.
    I just moved from google/enom to and exported my inbox in mail app. During the last year or more I started organising my inbox [mail app] in folders [right click / new inbox].
    In other words: emails arrive at info@mydomain then I organise them in folders.
    I was told to export my main inbox info@mydomain and I thought that my folders would be merged and gathered in that .mbox file. Unfortunately what happened is that I lost all my emails organised in folders. It goes without saying that those were the most important emails.
    Is there any way to recover this disaster?
    I would really appreciate your point of view.

  6. Hi Luna,

    I’m sorry to hear about your issues.

    Hopefully you have a backup of your whole hosting account (if it’s cPanel you can pull one) and you can pull your emails out of the cPanel backup.

  7. koppit

    Use this site – it does the trick, no dragging and dropping!

  8. Hi Koppit,

    This is a pretty spammy comment but we’re about to do some mail moves again of less sensitive mailboxes and the pricing at looks reasonable.

    We’ll see you in a week or two with more detailed comments.

    Making the web work for you, Alec

Leave a Reply