Gmail to Google Apps Email Migration (part 2)
I promised an Amazon EC2 AMI with imapsync and a few Gmail migration scripts. See the Gmail to Google Apps Email Migration post for background information. I'll jump right in with a procedure to get you started with your own migration:
- Run the instance: ami-01789d68
ec2-run-instances ami-01789d68 -k your-own-keypair - Use your key to authenticate through SSH using the username "gimapsync". See Running an Instance in the Amazon EC2 Getting Started Guide for more information.
- Edit the 'run-imapsync-justfoldersizes' script:
nano -w run-imapsync-justfoldersizes- Change alias@gmail.com to your 'from' email address
- Change alias@google-apps-domain.com to your 'to' email address
- Edit the 'run-imapsync-all' script the same way
- Edit the 'run-imapsync-folder' script the same way
- Create passfile1, which should contain the password for your 'from' email account
nano -w passfile1 - Create passfile2, which should contain the password for your 'to' email account
nano -w passfile2 - Test it out with
./run-imapsync-justfoldersizes- It should connect to both accounts and list each imap folder and its size
- If you are feeling lucky, just run
./run-imapsync-all - Otherwise, go one folder at a time with commands like:
./run-imapsync-folder "[Gmail]/Sent Mail"
Feel free to edit the run-imapsync* scripts to fit your needs. There are many command-line features of imapsync that I have not made use of here. You may be interested in the '--maxage N' parameter, for example. It only transfers email that are newer than N days old.
Let me know how it goes!
April 25th, 2008 at 5:36 pm
Wow. Thanks for writing this up and setting up the EC2 image. This was a life saver. Still running the conversion, but it seems to be going off without a hitch!
April 28th, 2008 at 12:09 pm
You need to be sure that when editing the command-lines, you not only change “alias@gmail.com” to your old email and “alias@google-apps-domain.com” to your new email, but that you also change “alias\@gmail\.com” and “alias\@google-apps-domain\.com” as well.
It might be a good idea, in the future, to handle the escaped and non-escaped versions programmatically, and store the email address in shell variables (to make editing them easier)
Awesome job though, thanks!!
- Cowboy
June 8th, 2008 at 7:16 am
Thanks for setting up this image. Other than the problem of imapsync dying periodically during a long transfer, it works very well! Getting imapsync to run on my own Mac wasn’t going well. The ec2 image saved me a lot of time.
June 28th, 2008 at 3:36 pm
Hi,
would you mind sharing the scripts and your version of imapsync? I have the problem that if I sync my Gmail account with my GApps account some of the attachments get broken. Somehow there seem to be some missing bytes at the end of an email…
Thanks in advance
July 3rd, 2008 at 11:09 pm
ff, the script is here - http://www.thamtech.com/blog/2008/03/29/gmail-to-google-apps-email-migration
I’m having a similar problem syncing my Gmail with a local IMAP server, or my ISP’s IMAP server. The end of messages are truncated.
August 3rd, 2008 at 10:41 am
Great tool - thanks for sharing! Have you done any other interesting AMI work recently?
G
August 13th, 2008 at 3:12 pm
Thanks for the tool, but when I try to log in using Putty, I get a message that there is no Authentication Method.
Is there a way to set it up (without a key pair), but using a default username and password? please?
August 14th, 2008 at 2:37 am
Bruce, I’m sorry to hear you are having trouble using a key pair. Setting up the AMI and publishing a default username and password is a bad security practice and could result in someone finding, publishing, and/or using YOUR gmail passwords.
Take a look at the “Running an Instance” section (http://docs.amazonwebservices.com/AWSEC2/2008-02-01/GettingStartedGuide/index.html?running-an-instance.html) of Amazon’s Getting Started Guide. It explains how to set up a key pair and has a note about making it work with Putty.
Tyler
August 14th, 2008 at 10:22 am
Tyler, thanks for the reply. I’m using Elasticfox (a Firefox Extension for Amazon EC2, no need to use command line tools, or java), so in 1 click I run the instance, but I can’t SSH.
What I meant with defalt username/password was to access the instance. Only I know the DNS address of my instance, and it’s only for a few minutes/hours. I would login with a default root/pass, run the scripts, the delete the instance.
By the way, I have about 800 MB in Gmail.
August 15th, 2008 at 11:08 pm
FWIW, http://google.com/support/a/bin/answer.py?answer=61369
seems to be working fine for me migrating from an @gmail.com account to a GAFYD account with no external programs/processes (all google-hosted).
August 25th, 2008 at 10:50 am
I ended up following these steps http://glomerate.wordpress.com/2008/08/20/migrating-from-gmail-to-google-apps/
October 13th, 2008 at 9:33 pm
Well, that was very useful. (And my first foray into AWS.) Thank you for providing this.