Convert a Gmail account from POP to IMAP and keep folder structure?

I currently use POP to access my gmail through thunderbird, but I would like to switch to IMAP so that my folders are mirrored on the server, and my sent emails are also available through the web interface.

The problem is that I have 1000s of emails in many different folders in Thunderbird, and in gmail, all my emails are in the same folder.

How can I perform the migration, and get all my folders from my POP access into Gmail?


Setup a new IMAP account in Thunderbird then simply drag&drop your folders from the POP3 account into the IMAP account.


This post from Google might answer your question on how the transition will work:

How do actions sync in IMAP?

Here's a guide to how other actions in your IMAP client will appear in the Gmail web interface.


I'm not really sure though how this will help you, it just explains how working with IMAP is translated to Gmail.