Migrating from Gmail to Google Apps

I moved over to Google Apps Standard Edition for all of my email needs. Unfortunately, they don’t provide much in the way of migration tools. Since I wanted all 1.6GB of email moved over, this was going to be painful.

In the end, I went with imapsync, using the following command:

imapsync --host1 imap.gmail.com --port1 993 \
    --user1 aidanfindlater@gmail.com --passfile1 asdf --ssl1 \
    --host2 imap.gmail.com --port2 993 \
    --user2 aidan@aidanfindlater.com --passfile2 asdf --ssl2 \
    --syncinternaldates --split1 100 --split2 100 \
    --authmech1 LOGIN --authmech2 LOGIN \
    --regexmess 's/Delivered-To: aidanfindlater\@gmail.com/Delivered-To: aidan\@aidanfindlater.com/g' \
    --regexmess 's/<aidanfindlater\@gmail.com>/<aidan\@aidanfindlater.com>/g' \
    --regexmess 's/Subject:(\s*)\n/Subject: (no--subject)$1\n/g' \
    --regexmess 's/Subject: ([Rr][Ee]):(\s*)\n/Subject: $1: (no--subject)$2\n/g' \
    --useheader 'Message-Id' --skipsize

To be honest, most of this is voodoo to me, and I can’t remember where I got them from. The regex’s above didn’t work perfectly (there are some leftover Re:’s), but I wasn’t willing to resync everything just to fix that problem.

Things to note:

  • the file asdf is a text file containing the password (nothing else)
  • in the regexes, I am moving from aidanfindlater@gmail.com to aidan@aidanfindlater.com
Leave your thoughts
  • You can use some HTML in your comment.
  • Your comment may not display immediately due to spam filtering. Please wait for moderation.