imapsync is a command-line tool that connects to two IMAP mailboxes, the source and the destination, and copies messages folder by folder, skipping those already there. That is why you can run it more than once without duplicates. It is for when mailboxes are many or very large and dragging folders in a mail program is no longer practical. It is a third-party program: we do not sell it, and our support does not install or repair it (how far our support goes). For a few mailboxes, the mail-program route in bringing your mailboxes from another provider is simpler.
When it makes sense
| Situation |
What to use |
| One or two small mailboxes |
The mail program, dragging folders. |
| Many mailboxes, or mailboxes with years of messages |
imapsync, running on your computer or on a VPS. |
| The old provider also uses cPanel |
Ask us: the panel-to-panel copy brings folders, read marks and dates. |
What to prepare
| 1 |
The mailboxes exist at the destination, with the same addresses and enough space (full mailboxes).
|
|
| 2 |
You have the passwords on both sides. Some providers only allow IMAP access with an app password, or with IMAP switched on in the account settings. Ask for them now: it is what takes longest.
|
|
| 3 |
IMAP over SSL on both sides. On our side the server is mail.yourdomain.tld, the port is 993 with SSL, and the user is the full address.
|
|
| 4 |
Choose where to run it. On your computer or on a VPS of yours. A shared hosting account is not the place. Install it following the project’s own instructions.
|
|
The command, slowly
The basic form connects both sides and always starts with a dry run, which copies nothing and only shows what it would do. The values are examples:imapsync --host1 mail.old.tld --user1 ana@yourdomain.tld --passfile1 /path/pass1.txt --ssl1 \
--host2 mail.new.tld --user2 ana@yourdomain.tld --passfile2 /path/pass2.txt --ssl2 \
--dry
The files named in --passfile1 and --passfile2 hold only each side’s password: that way the password does not end up in the command history or the process list. When the dry run looks right, remove --dry and run it for real. At the end the program prints a summary of what it copied.
| 1 |
Dry run with --dry. Read the summary: the folders it found, the messages it would copy.
|
|
| 2 |
Run one small mailbox for real and open it in webmail (or in a mail program) to see the folders, the dates and the read marks.
|
|
| 3 |
Run the others, one at a time. For many mailboxes, a list with one line per mailbox and a small shell loop save repetition.
|
|
| 4 |
Change the MX only at the end and run imapsync again afterwards, to catch the messages that still arrived at the old place.
|
|
| 5 |
Compare the counts. Messages per folder, on both sides, should match.
|
|
|
Leave out the options that delete at the destination. imapsync has options whose names say they delete messages at the destination or the source. A migration needs none of them; using them without understanding them deletes real mail.
|
|
The old server may throttle the copy. Some providers limit IMAP speed or the number of connections. If a run slows down or fails, run it again: since it only copies what is missing, it picks up where it stopped.
|
|
After the MX, the SPF. When mail starts leaving from here, the SPF, DKIM and DMARC records have to point here (SPF, DKIM and DMARC). Without that, your messages land in recipients’ spam.
|
|
Need to move many mailboxes and would rather we handled it? Tell us where they come from and how many there are.
Open a support ticket
|
RECOMMENDED PRODUCT Professional e-mail on your domain Mailboxes in your company name, no adverts, with spam filtering. from 5.940,00 Kz/mo (3-year plan, with coupon) See plans |