An email migration sounds like a simple technical job: copy the mailbox, configure the new server, done.
In reality, it's often the moment when you discover how much clutter has built up over the years.
The biggest mistake is starting with the wrong goal. If you try to reproduce every folder and habit exactly as it was, you move the old problems along with the messages.
My approach is simple but strict: back up first, migrate second, clean up afterwards.
Define the target before you start
Before running a single command, decide:
- Which destination server and mailboxes will be used
- Which folder structure you actually want to keep
- How you will perform and verify a server-to-server transfer
- How long the old account will stay available during the cutover
Mail clients are excellent for reading mail. They're not my first choice for moving very large mailboxes, because a long copy operation is more likely to be interrupted.
Step 1: Create a complete independent backup
Migrating without a separate backup is asking for trouble.
For IMAP, the safe starting point is a full copy of all folders to another system or backup destination. You can use a dedicated IMAP backup tool or download a complete local copy.
Important distinction: Copying mail from an old server directly to the new one isn't by itself an independent backup. If you later make a mistake on either side, both copies can be affected. Keep an additional recoverable archive.
I used imapsync for the server-to-server transfer because it can preserve internal dates and message flags and can be run again after an interruption.
The command structure looks like this:
imapsync \
--host1 imap.oldserver.example \
--user1 user@example.com \
--host2 imap.newserver.example \
--user2 user@example.com \
--ssl1 --ssl2 \
--automap \
--subscribeall \
--syncinternaldates
Pass passwords with a secure method supported by your imapsync version. Putting them directly on the command line may expose them in shell history and process listings.
Run a first full copy and verify the result. Don't delete anything yet.
Step 2: Inspect the mailbox
Before cleanup, it helps to look at what is actually taking up space:
- The biggest folders
- Newsletter and automated senders
- Old project directories
- Messages with very large attachments
In my experience, notifications, newsletters and big attachments can account for a surprising amount of mailbox storage.
Typical candidates for later cleanup are:
- Log messages
- System notifications
- Social media mail
- Years of unread newsletters
But first establish retention requirements. Some messages and attachments may have legal or business value.
Step 3: Run the migration
Create the destination mailboxes and check their settings. Then run imapsync again.
For very large mailboxes, the following option can reduce overhead:
--nofoldersizes
Be careful with destructive sync options. For example:
--delete2
may remove destination messages that don't exist at the source. That's useful only if you deliberately want that behaviour and have confirmed it won't delete mail already delivered to the new server.
I avoid deletion flags during the initial migration.
Run several incremental passes. imapsync is designed to skip mail it has already copied, so later passes should be quicker.
During the transition, don't reorganise mail on both servers simultaneously. That makes comparisons and troubleshooting needlessly difficult.
Step 4: Clean up after migration
Only once I know the transfer worked do I start clearing out clutter.
That includes:
- Identifying and archiving or deleting oversized attachments
- Removing verified duplicates
- Consolidating old archive folders
- Deleting obsolete notifications once retention requirements are satisfied
This can reduce both storage use and search clutter.
The crucial point is the order: don't combine an irreversible cleanup with an unverified migration.
Step 5: Rebuild server-side filtering
A common mistake is configuring all filters inside one desktop mail client. Change device and the rules stop working.
Where supported, put rules on the server:
- Archive invoices automatically
- Move newsletters into their own folder
- Keep routine system notifications out of the inbox
That way, the rules also work when you're using a phone or a different computer.
Step 6: Final checks
Before switching off the old account:
- Compare folder and message counts
- Check random messages in every important folder
- Confirm dates, flags and attachments
- Test search
- Send and receive new messages
- Run one final delta synchronisation
- Keep the independent backup and the old account for an overlap period
Counts alone aren't a complete integrity check, but they're useful for finding obvious gaps.
Mistakes worth avoiding
- Migrating without a backup you can restore
- Deleting mail during the initial copy
- Enabling delete flags too early
- Copying an overcomplicated folder structure without thinking
- Relying entirely on a mail client for a large migration
- Testing only the inbox while forgetting all the other folders
Conclusion
An IMAP migration is more than a copy job. It's an opportunity to make your mail setup manageable again.
If you simply copy everything, you take the chaos with you. If you back up, migrate, verify and only then clean up, you end up with a smaller, clearer mailbox and fewer maintenance headaches.
The inbox should be a working tool, not a museum of the last fifteen years.