In November we began migrating our clients’ email from our own server to MXroute, a specialised email provider. The first three waves covered 51 domains and around 180 mailboxes. The migration ran in stages: first we transferred the contents of each mailbox, then switched the DNS records, and finally resynced everything that had arrived in between. Then the provider began extensive maintenance, and we had to decide quickly.
What Happened
At the end of November, MXroute started extensive maintenance and a data migration on the server holding our mailboxes, which we also kept clients updated on in a separate post about the disruption. Webmail was working, but access through email clients such as Outlook and phone apps was not. That wasn’t acceptable for our clients, so we decided to move the email back to our own server temporarily.
What We Did in One Evening
- We notified every client by email before making any changes, explaining what was about to happen and what they needed to do.
- We switched the mail DNS records (MX) for all 51 domains back to our server. The domains use DNS at different providers, including Cloudflare, Pressable, Kinsta and QUIC.cloud, with some on our own server, so each one had to be handled where it lives.
- We checked and fixed the SPF, DKIM and DMARC records for every domain, so outgoing mail wouldn’t land in spam. We repaired broken DKIM keys on four domains and added a DMARC record to ten that didn’t have one.
- We configured all domains on our server for local mail delivery.
The Hardest Part: Mail That Had Arrived at the Provider
In the weeks after the migration, clients had received several thousand messages that existed only at the new provider. The standard transfer method over IMAP wasn’t working because of the maintenance, so we wrote our own tool that:
- logs in to the webmail of each mailbox and reads the original messages,
- compares every message against the contents on our server and transfers only the ones that are missing,
- preserves folders, the date received and the read and starred flags,
- sets sorting by date in webmail, so messages appear in the right order.
We tested the tool on a single mailbox first and checked the result by hand, and only then ran it across all of them. Within half an hour we had returned more than 6,000 messages from 176 mailboxes to our server, with no errors and no duplicates. A few special cases, such as a full mailbox and a changed password, were handled individually.
Why This Matters
Clients could read their email the whole time and not a single message was lost. In Outlook and on their phones, all they had to change were the server settings. This is exactly why maintenance exists. When something goes wrong at an external provider, a client shouldn’t be left alone with an email outage, a status page to refresh and no idea where their messages went.
What Happens Next
We’ll continue the migration once MXroute completes its maintenance, using the same approach: test everything on one mailbox first, then run it across all of them. If you’d like to know how your own email is set up and what happens if your provider goes down for a few days, get in touch.