To migrate email to a new host without losing messages, you set up the mailboxes at the new provider first, copy existing mail across over IMAP while the old host is still live, switch your MX records, then run a final sync to catch anything that arrived during the changeover. Done in that order, nobody loses mail and most staff barely notice the move.
This guide covers the full process, including DNS timing, tools for copying mail and a checklist for the day of the switch.
Before you start - take stock
Make a list of everything that exists today:
- Every mailbox, with its size and the person who uses it.
- Aliases and forwarders, such as
info@delivering to two people. - Shared mailboxes and who has access.
- Autoresponders and mail filters that need to be recreated.
- Current DNS records: MX, SPF, DKIM, DMARC and any autodiscover records.
- Services that send as your domain, such as your website forms, accounting package and newsletter tool.
- Login details for the old mailboxes, or admin access to the old host.
Check whether anyone uses POP3. POP3 users may have mail that exists only on their own computer, not on the server, so a server-to-server copy will not include it. Read IMAP vs POP3 for how to upload local mail to the server before the move.
Step 1 - Lower the TTL on your MX records
TTL (time to live) controls how long other servers cache your DNS records. At least a day before the switch, lower the TTL on your MX records to something short, such as 300 seconds (5 minutes). When you change the MX records later, the new values spread quickly.
example.co.za. 300 IN MX 10 mail.old-provider.example.
Step 2 - Create the mailboxes at the new host
Recreate every mailbox, alias and forwarder at the new provider. Use the same addresses. Set temporary passwords that you will share with staff on switch day, or keep the same passwords if you can do so securely.
Set mailbox sizes large enough for the mail you are about to copy, plus room to grow.
Step 3 - Copy existing mail over IMAP
The reliable way to move mail is an IMAP-to-IMAP copy: a tool logs into the old mailbox and the new one, and copies every folder and message across, preserving dates and read status.
Options include:
- Your new provider's migration service or import tool. Many providers will do the copy for you.
- An IMAP sync tool such as the open-source
imapsync, run by someone comfortable with the command line:
imapsync \
--host1 mail.old-provider.example --user1 [email protected] --password1 'OLD_PASSWORD' --ssl1 \
--host2 mail.example.co.za --user2 [email protected] --password2 'NEW_PASSWORD' --ssl2
Because the MX records have not changed yet, you need to connect to the new server by its hostname or IP address, not via your domain's MX. Your new provider will tell you which hostname to use.
- A mail app with both accounts added. For a handful of small mailboxes, you can add the old and new accounts to the same app and drag folders across. It is slow for large mailboxes and easy to miss folders.
Run the first copy a day or two before the switch. It takes the longest because it moves everything.
Step 4 - Prepare the new DNS records
Collect the new records from your provider, but do not publish the MX change yet:
example.co.za. 300 IN MX 10 mail.example.co.za.
example.co.za. 3600 IN TXT "v=spf1 mx include:_spf.newprovider.example ~all"
default._domainkey.example.co.za. 3600 IN TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
_dmarc.example.co.za. 3600 IN TXT "v=DMARC1; p=none; rua=mailto:[email protected]"
These are examples; the exact MX hosts, SPF includes and DKIM keys come from your new email provider. Remember to keep includes for other services that still send as your domain. SPF, DKIM and DMARC explained explains each record.
Step 5 - Switch the MX records
Pick a quiet time, such as late afternoon on a Friday or early morning.
- Replace the old MX records with the new ones.
- Update SPF to include the new provider, and publish the new DKIM record.
- Leave the old mailboxes active. Some servers will keep delivering to the old host until their cached records expire.
If you are changing nameservers at the same time as moving email, make sure every record exists at the new DNS provider before you switch. What are nameservers covers this.
Step 6 - Reconnect devices
Give staff the new settings (server names, ports, passwords) and help them reconnect phones and Outlook. It is often easiest to remove the old account and add the new one. The settings are the same as in how to set up email on your own domain.
Step 7 - Run a final sync
After a few hours, and again the next day, run the IMAP copy again. Sync tools skip messages that already exist and only copy what arrived at the old host during the changeover. That is how you avoid losing the stragglers.
Step 8 - Check and clean up
- Send test messages in and out of each mailbox. Check headers show SPF, DKIM and DMARC pass.
- Test website forms and other services that send as your domain.
- Raise the MX TTL back to a normal value, such as 3600.
- Keep the old email account for a week or two, then cancel it once you are sure nothing is still arriving there.
Migration checklist
- Inventory of mailboxes, aliases, forwarders and filters
- POP3 users' local mail uploaded to the server
- MX TTL lowered a day in advance
- Mailboxes created at the new host
- First IMAP copy complete
- New MX, SPF, DKIM and DMARC records published
- Devices reconnected
- Final sync run
- Old account kept for a short overlap, then cancelled
Frequently asked questions
Will I lose emails during the migration?
Not if you follow the order above. Mail that reaches the old host during the switch is picked up by the final sync, and mail that reaches the new host is already in place.
How long does an email migration take?
Setup and DNS changes take an hour or two. Copying mail depends on mailbox sizes and connection speed; large mailboxes can take many hours, which is why the first copy should run before switch day.
Do I need to move my website and email at the same time?
No. They are controlled by different DNS records, so you can move one without the other. Moving them separately is often less stressful.
Can I migrate from Google Workspace or Microsoft 365 to email hosting?
Yes. Both support IMAP access, so the same IMAP copy approach works, though you may need to enable IMAP or app-specific access first. Calendars and contacts need to be exported and imported separately.
What happens to email sent to the old server after I cancel it?
Once the old account is cancelled, anything still being delivered there will bounce or be lost. That is why you keep the old account active for a week or two after switching MX records.
Moving your email and would like a hand? NewHost email hosting gives you mailboxes on your own domain in South Africa, and you can contact us to plan the migration together.