Loading Smiley Hoster
Skip to content

Migrate hundreds of IMAP mailboxes with imapsync and a controlled cutover

Smiley Hoster Team · · 2 min read
Migration timeline showing pre-copy, differential sync, MX cutover and acceptance.

Moving hundreds of mailboxes requires evidence of completion, not a promise of zero downtime. For a 2026 migration project, use imapsync to pre-copy messages while the old service remains available, then control the cutover with per-mailbox checks.

1. Inventory before opening the migration window

Record addresses, aliases, quotas, folder structures, mailbox sizes and clients. Plan contacts, calendars, rules, signatures and delegation separately: copying IMAP messages is not a complete groupware migration.

Provision destination accounts and verify storage. Back up the source. Select pilot users with large mailboxes, accented folder names and substantial sent-mail history.

Create two operator-only password files. This Bash example targets conventional IMAP authentication; adapt the method for your providers:

Example
chmod 600 /secure/old.pass /secure/new.passimapsync --host1 old.example.com --ssl1 --user1 user@example.com --passfile1 /secure/old.pass --host2 new.example.com --ssl2 --user2 user@example.com --passfile2 /secure/new.pass --sslargs1 SSL_verify_mode=1 --sslargs2 SSL_verify_mode=1 --dry

Check certificate trust and hostnames instead of weakening validation after an error. A dry run prepares the attempt without copying messages; it does not prove that the full mailbox will transfer successfully.

2. Run measured, restartable batches

Remove --dry after the pilot checks to perform the initial copy. Do not add deletion or expunge options. Repeat the same migration parameters to copy missing messages.

Track each mailbox's start, finish, exit status, errors, folder differences and last successful pass. Protect logs because they can reveal addresses and folder names.

Start with modest concurrency. Increase only while source and destination CPU, storage, network and provider limits allow it. A failed mailbox should remain explicitly failed rather than being hidden by an overall batch completion message.

Compare folder coverage, volume and sampled messages, including attachments, dates and flags. Raw message counts are insufficient where providers represent virtual folders differently. Explain every known difference before proceeding.

3. Switch routing and reconcile residual delivery

Lower DNS TTL early enough for the previous value to expire. Temporarily authorize both legitimate sending systems in one SPF record, prepare destination DKIM and preserve DMARC alignment.

After validating the new server, an illustrative MX change is:

Example
example.com. 300 IN MX 10 new.example.com.
Example
dig +short MX example.comdig +short TXT example.comdig +short TXT _dmarc.example.com

Move clients to the destination and run another differential pass. Keep the old service reachable for senders with cached routing, repeating synchronization until observations show residual arrivals have stopped.

Test external receipt, SMTP sending, replies and IMAP login. Do not retain an old backup MX without a deliberate routing design; it could continue accepting mail independently.

Common mistakes

Closing the source too early, enabling deletion propagation and overlooking sent messages created during transition can cause avoidable gaps.

FAQ

Can the project guarantee no interruption? No. Announce a support window and provide user assistance.

Is restoring the old MX enough to roll back? No. Reconcile messages already received at the new service as well.

Final check

Retire the source only when every mailbox has a successful final pass, explained differences, SMTP/IMAP acceptance results and owner confirmation.

Sources: imapsync, imapsync — options.

Slide 1 of 6: Email migration. Moving mailboxes? Verify every one.. Use imapsync batches and per-mailbox checks to control your cutover.
Slide 2 of 6: Prepare the migration. Inventory before you copy. Record accounts, aliases, quotas and folders. Provision storage and back up the source. Pilot varied mailboxes. Plan contacts, calendars and rules separately: IMAP copies messages.
Slide 3 of 6: Copy and verify. Run measured batches. Start with modest concurrency. Track errors and successful passes per mailbox. Repeat copies for missing messages without deletion options. Check folders and sampled messages, not just counts.
Slide 4 of 6: Control the cutover. Switch routing. Keep checking.. Lower TTL early; prepare SPF, DKIM and DMARC. Validate the destination, switch MX and move clients. Repeat differential copies while the old service receives residual mail. Test sending, receipt and IMAP login.
Slide 5 of 6: Before source retirement. Check every mailbox. Successful final sync pass. Known differences explained. SMTP and IMAP checks passed. Mailbox owner confirmation
Slide 6 of 6: Plan your email migration. Make the cutover controlled. Read the guide for the imapsync workflow and final checks. Announce a support window and help users through the move.
On social media

See it in our social posts

The key steps of this article, as a carousel. Follow us to catch the next ones.

Did this article answer your question?
Your feedback shapes what we write next.

Your site online today

Free migration* · 30-day refund

Get started* A site under 30 GB, cPanel, WordPress and VPS plans.