Tuesday, October 30, 2007

Migrating from Gmail's POP to IMAP: the (sort of) easy way

I've read a lot of posts about what happens if you use labels in Gmail and how they get messed up in clients like Outlook, iPhone, Thunderbird, etc. This article attempts to answer the opposite question:
What if I never use gmail's web interface because I always download and organize my mail in my own mail client using POP?
If you're like me and use Outlook 2003 (or some other program) to access Gmail's mail via POP, you've probably created some sort of folder structure to manage all those emails. If you're also like me, you rarely use Gmail's web-based interface to keep the messages organized there, too. The result is an organized mail folder system at home but an unorganized mail folder system on the web. Making matters worse, all these messages on the web appear to be unread and still sitting in the inbox because you've already downloaded them into your favorite email client.

Here's an easy--though time consuming--way to get things looking the way they have always been. Keep in mind, if you have thousands of emails, this process will take a *long* time and I do mean *long*.

The following assumes you've been downloading your Gmail via POP; you have IMAP enabled in Gmail; and that you have NOT YET set up your IMAP account in your favorite mail client.
  1. DISABLE SEND/RECEIVE for your current POP-accessed Gmail account
    DISABLE SEND/RECEIVE for your current POP-accessed Gmail account
    DISABLE SEND/RECEIVE for your current POP-accessed Gmail account

    Why? Failure to do so will result in your email client downloading all the email you are about to move from your computer to Google's IMAP server. Don't ask me how I know this.

  2. Start emptying out all folders in Gmail, since you've already downloaded them once via POP.
    1. Starting with the Inbox, choose Select All, then right below that click "Select all [X] conversations in [Current Mailbox]"

  3. Click the Delete button
  4. Repeat for each folder until you have no mail left in any of your Gmail folders
  5. Create your new Google IMAP account in your favorite email client
  6. Transfer your previously-downloaded messages back over to IMAP

    WARNING: if you have a lot of mail in a particular box, it will take some time to transfer everything.

    1. To make IMAP's folder structure replicate your email client's current folder structure, simply drag your old folder into the IMAP root (imap.gail.com). On the web, Gmail will treat these newly created folders as "labels".

  7. Enjoy a cup of coffee while you wait. If you have amassed many emails over the months/years, I'd recommend finding something more productive to do than sip coffee. Perhaps you might make and eat dinner. If it's a really large folder, you might just want to let it run overnight or while you're out running errands, as it could take hours for the transfer to complete.
  8. Repeat for each folder you want to add to Gmail's IMAP account.
To verify this process is working, initiate the transfer of the first mailbox's messages to the corresponding IMAP folder, then head on over to Gmail on the web and browse that same folder. After 15 seconds or so, refresh that page to confirm that the number of emails in that mailbox has increased.

While this method takes a while, it will be worth it in the long run; you'll have all your organization set up the way you like it, the way it has always been.

Hope this helps.