Migrate your email without losing messages when you change provider
To migrate your email without losing messages, first identify where the mailboxes are, copy them while the previous provider is still active and repeat the synchronisation just before changing the DNS.
Migrating your hosting to Hostsuar is free, and we can also take care of moving your email. This guide explains the process and the checks you need, whether our team does it or you use the service's tools.
Find out where your email is
A website being hosted with one provider does not mean that provider also receives the email. Check the domain's MX records and the panel the mailboxes are managed from.
Choose the scenario that applies:
| Current situation | Process |
|---|---|
| Email inside a cPanel account | Restore a full backup and check the mailboxes and connection settings |
| IMAP email on Plesk or another panel | Create the destination accounts and synchronise them with imapsync |
| Google Workspace or Microsoft 365 will stay active | Do not copy the mailboxes to cPanel; keep their DNS records |
| Email downloaded over POP with no copy on the server | The messages may exist only on the devices and need a local copy |
| Microsoft Exchange with contacts and calendars | Review messages, contacts, calendars, rules and files separately |
If the source also uses cPanel
A full cPanel backup normally includes the email accounts, their passwords, folders, messages, forwarders and filters. After restoring it:
- Check that every mailbox appears.
- Compare the space used with the source.
- Sign in to webmail and look through several folders and messages.
- Test sending and receiving before retiring the previous service.
- Confirm which server Outlook, Thunderbird, phones and applications are set up with.
If devices use mail.tudominio.com, you may not need to change their configuration once the DNS has propagated. If they use the previous server's internal name, you will need to replace it with the new service's connection settings.
If the source uses another panel or IMAP server
1. Create the destination accounts
Create the same addresses in cPanel and assign enough quota to receive all their content. A destination account without space can leave the synchronisation incomplete.
Also list forwarders, filters and autoresponders. Imapsync copies messages and folders, but does not on its own reproduce all the previous provider's configuration.
2. Get the source IMAP details
For each account you need:
- IMAP server.
- Port and encryption type.
- Full address as the username.
- App password or temporary credential.
The server name may be different from the domain. Confirm it in your current provider's panel or documentation.
3. Run a first synchronisation
Use the migration and synchronisation interface with imapsync. The first copy can be made in advance and does not change or delete the content at the source.
If you need advanced options, see the guide to imapsync from the terminal.
4. Check the destination
Sign in to the new service's webmail from cPanel even if the domain still points to the previous provider. Check:
- Inbox and sent items.
- Folders created by the user.
- Old and recent messages.
- Space used.
- Errors reported by the synchronisation.
5. Repeat the synchronisation before the switch
While the DNS still points to the source, messages will keep arriving there. Run imapsync again immediately before the switch: it will compare the accounts and copy anything not yet at the destination.
Do not delete or mass-reorganise messages during this stage. Changes can make the comparison take longer or cause a message deleted at the destination to be copied again from the source.
6. Change the DNS and do a final check
When the DNS is changed, some senders may keep delivering to the previous server for a while because of propagation. Keep both services active and run a final synchronisation after the cut-over.
Carry on with the guide to changing DNS with minimal interruption.
If you are keeping Google Workspace or Microsoft 365
Do not create equivalent mailboxes in cPanel if your email will stay with the external provider. Before changing the DNS servers, copy into the new zone every record the service uses:
- MX records.
- SPF and TXT verifications.
- Autodiscover and other CNAMEs.
- SRV records needed for its applications.
Also set email routing to remote so that the website and cPanel do not try to deliver locally messages meant for the external provider.
See the specific guides for Google Workspace and for the Autodiscover conflict between cPanel and Microsoft 365.
What imapsync does not replace
An IMAP synchronisation focuses on messages, folders and their status. Review separately:
- Contacts and calendars.
- Rules set up at the provider.
- Signatures and autoresponders.
- Microsoft 365 or Google Workspace files.
- Shared mailboxes and groups.
- Messages a POP client has downloaded without leaving a copy on the server.
Protect your credentials
Do not write passwords in a ticket, email or command visible in the history. Use the service's protected interface or the secure channel support tells you about, create app passwords or temporary credentials where possible and revoke them when you finish.
Do not cancel the source until you have checked
Before retiring the previous provider, confirm that:
- Every mailbox exists at the destination.
- The number of folders and the space used are consistent.
- No recent messages remain only at the source.
- Devices can send and receive.
- The website can send forms and notifications.
- The MX, SPF, DKIM and DMARC records belong to the final provider.
- The temporary credentials used have been revoked.
Once your email is checked, complete the rest of the process with the guide to migrating hosting to Hostsuar.
If the result does not match
Do not decide based on total MB alone: providers and labels can count differently. Review the log for each mailbox, excluded folders, provider limits and specific missing messages. A successful authentication test does not check the content.
Stop retiring the source if there are unexplained errors. Note down for each account what has been copied, the last synchronisation and the sending and receiving test. That record lets you continue the work without repeating decisions or losing sight of a small mailbox that is also still receiving email.
You may also find useful
- Copy email from Gmail or Google Workspace to Hostsuar Explains how to authenticate a Gmail or Google Workspace account securely to copy its mailbox to Hos...
- Migrate email from the panel with imapsync Prepare the source and destination, test the connection and review the result of a mailbox copy from...
- Use imapsync over SSH to copy email between providers Shows how to copy a whole mailbox with imapsync over SSH, using TLS and protected files for the cred...
- Archive a domain's incoming and outgoing email in cPanel Set the scope and retention of cPanel's email archive and check how to access it without mistaking i...
Something wrong or out of date? Tell us and we will review it.