How to Migrate Email Accounts to a New Host Without Losing Messages
To migrate email accounts to a new host, copy every mailbox over IMAP with a tool that preserves flags and internal dates, then switch the DNS records once the copy is verified. Nothing is lost if you keep the old server reachable and accepting mail until the new one has proven it can receive, store and serve the same messages.
Email migration is easier than most people fear because IMAP is a standard sync protocol, not a proprietary export format. Any client or tool that speaks IMAP can read from one server and write to another. The two things that trip people up are message metadata (read/unread state, flags, internal delivery dates) and the cutover window, when mail sent to the old address must not vanish. Plan for both and the rest is mechanical.
Map the accounts before you migrate email accounts to a new host
Start with an inventory. For each domain you control, list the mailboxes, the aliases, the forwarders, the catch-all rules and any shared or role accounts such as sales@ or postmaster@. Note which mailboxes are real IMAP accounts and which are simple forwarders, because forwarders carry no stored mail and only need a rule recreated on the new side.
Record the DNS state of the domain: the MX records, the SPF TXT record, any DKIM selector records and the DMARC policy. You will need to reproduce these on the new provider, and forgetting DKIM is the most common cause of mail landing in spam after a move. A quick check looks like this:
dig +short MX example.com
dig +short TXT example.com
dig +short TXT selector1._domainkey.example.com
Save that output. It is your baseline for verifying the cutover later, and it tells you which selectors the new provider must publish.
Copy the mailboxes over IMAP
The reliable approach is a server to server sync. imapsync is the long standing tool for this and is worth learning because it handles the details that naive copies miss: it preserves internal dates, flags and keywords, and it can run repeatedly to pick up new mail during the cutover window. A single mailbox run looks like this:
imapsync \
--host1 old.example.net --user1 [email protected] --ssl1 \
--host2 new.example.net --user2 [email protected] --ssl2 \
--usecache --skipsize --addheader
Three flags matter here. --usecache records message identifiers so a second run does not re-copy what already moved. --skipsize avoids needless re-checks on large mailboxes. --addheader stamps a header such as X-IMAPSYNC-ORIG on copied messages, which is invaluable when you later need to prove a message came across. Run it once per mailbox, then run it again just before cutover to pull the delta.
If you prefer not to install a tool, any IMAP client that supports two accounts can drag folders between them, but do it folder by folder and check the special folders. Sent, Drafts, Trash and Archive have server specific names, and a copy that lands Sent mail in a generic folder is a migration that looks done but is not.
Contacts, calendars and aliases need separate handling
IMAP carries mail only. Contacts and calendars usually live in CardDAV and CalDAV, and the portable format is vCard and iCalendar. Export from the old side, import to the new, and check that groups and distribution lists survive, because those are the parts that quietly disappear. If the provider offers a sync protocol endpoint, point a client at both accounts and copy between them rather than relying on a one time export.
Aliases and forwarders are configuration, not data. Recreate each one on the new provider and test it by sending a message to the alias from an external address. Do this before you touch MX, while the old server is still authoritative, so a failure is harmless.
Cut over with a short TTL and a rollback plan
Lower the MX record TTL well before the move so stale records expire quickly. The TTL is a count in seconds, for example 300, set in the zone file or the provider control panel. Then, once the initial copy is verified, repoint MX to the new provider, publish the new SPF and DKIM records, and run the sync one final time to collect anything that arrived on the old server in the gap.
Keep the old accounts active and receiving for a period after cutover. Mail sent to the old address by someone with a cached record will still land there, and you want it stored, not bounced. During this window, run the delta sync on a schedule, or set the old server to forward to the new one, so the two stay in step. Only decommission the old mailboxes once the MX change has propagated and you have confirmed nothing new has arrived on the old side for a full cycle.
Verify at the end with the same commands you used at the start. Check that MX points where you expect, that SPF and DKIM validate, and that a test message sent from an outside account arrives, is readable, and shows the correct headers. Open a few old messages and confirm their dates and read state match what you saw before the move.
Next, write the inventory down before you start, and keep the old server running until the new one has passed a full send and receive test. Treat the DNS change as the last step, not the first, and treat the delta sync as something you repeat rather than a single event. If you do those three things, the migration becomes a sequence of checkable steps instead of a leap of faith.
