IMAP migration and backup

Tools for working with IMAP accounts.

Notes on moving mail between servers and keeping local backups.

imapsync

The go-to tool. Handles folder mapping, deduplication, resumable.

imapsync \
  --host1 old.server.com --user1 me@old.com --password1 xxx \
  --host2 new.server.com --user2 me@new.com --password2 yyy

Flags I actually use:

--dry                     # test run
--exclude "Spam|Trash"    # skip junk
--folder "INBOX"          # single folder only
--regextrans2 s/Sent Items/Sent/  # rename folders

imapsync.lamiral.info

imap-backup

Ruby gem, stores mail as Mbox + JSON index. Good for offline archives.

gem install imap-backup
imap-backup setup    # interactive config
imap-backup backup   # run it

github.com/joeyates/imap-backup

Gotchas

  • Gmail/iCloud need app passwords
  • Check destination quota before migrating
  • --dry first, always

Read next

MacOS setup

My installation steps for setting up a new Mac computer