- Download messages from GMail/IMAP server
- Copy messages and/or labels to the target folder. This (locally) deletes converted emails from the IMAP server.
- Purge deleted messages from the IMAP server
If you have not limited the number of messages in the IMAP folders, it still makes sense to do these steps for all labeled messages first (including purge) to ensure that all labeled message indeed have been migrated. Migrating unlabeled messages will remove any remaining labels on those messages. (Actually, it will move them to Trash. You can recover your messages from Trash to recover any remaining labeled versions of the messages.) Once you verified that all labeled messages have been migrated, migrate the unlabeled messages.
Let's look at each step in detail:
1. Download IMAP messages
To download messages from IMAP, you first need to subscribe to the folders that you want to download. Do this by, right-clicking the GMail folder, and selecting Update Folder List. Once complete, right-click again and select IMAP Folders...
If you are migrating labeled messages, subscribe to all folders except [GMail]/All Mail. This will help keep your Outlook cache file smaller and the migration faster. At the end, subscribe to [GMail]/All Mail as well.
To subscribe to the folders, first select Query. This will list all IMAP folders.
Then select the desired folders you want to subscribe to, and click Subscribe. Subscribed folders will have a folder mark next to them. Once satisfied, click OK.
Then select the desired folders you want to subscribe to, and click Subscribe. Subscribed folders will have a folder mark next to them. Once satisfied, click OK.
Click Send / Receive => Send/Receive All Folders (or simply press F9) to download IMAP messages in the subscribed folders. This can take a while.
2. Run the conversion script
There are two ways to run the messages.
- From the Outlook window, you can press Ctrl+F8 to bring up the Macros menu.
- Alternately, you can run the macro from the Microsoft Visual Basic for Application window (that you started earlier with Alt+F11). Here you can follow the progress of the conversion in the Immediate window. To do this, Press Ctrl+G. You can bring up the Macros menu by selecting the top line and clicking F5. If you are not on the top of the script, there is a danger that the cursor is inside a runnable script, which will start without confirmation.
If there are still messages with labels, select import_all_labeled_messages and Run. Once you have migrated all labeled messages from GMail (not just the ones downloaded, but positively all labeled messages), you can run the second macro import_finally_all_mail.
You should not get any error messages, unless your mailbox gets full, or the IMAP connection is lost. If this happens, you can restart the conversion script and the conversion will continue. You will need to increase the PST size limit before continuing if the mailbox size limit has been reached. This setting will not take place until Outlook is restarted.
3. Purge deleted messages
Once the migrated messages have been deleted from the respective "label" folders, you also need to communicate this to the GMail server. You only need to do this if you elected to optimize the migration by doing cached deletion (e.g. set auto-expunge OFF, and mark items for deletion) prior.
To purge the deleted messages, select a folder on the IMAP server, click Folder => Purge => Purge All Messages for account.
This will take a while, but will enable you to download further messages and do the next round of migration.
NOTE: you will not be able to purge your messages in the "[Gmail]/All Mail" folder due to GMail's handling of deleting a message. Instead, you will have to move all of the deleted messages (these are marked by being crossed and greyed out) to the "[Gmail]/Trash" folder. This will remove them from the All Mail folder. You can then empty the trash in GMail.
NOTE: you will not be able to purge your messages in the "[Gmail]/All Mail" folder due to GMail's handling of deleting a message. Instead, you will have to move all of the deleted messages (these are marked by being crossed and greyed out) to the "[Gmail]/Trash" folder. This will remove them from the All Mail folder. You can then empty the trash in GMail.
Verification
Once you have migrated all labeled messages, verify on the GMail server, that in fact, there are no conversations under any labels (you can do this under Settings => Labels), as well as in your Inbox, Starred messages, Important, Sent Mail, Drafts, Spam, and Trash. This means that all labeled messages have been successfully migrated.
To complete the migration, you will also need to migrate any remaining mail without any labels. You need to make sure you are subscribed to the [Gmail]/All Mail folder, and repeat the conversion step, this time running import_finally_all_mail macro. This will move all mail into the Trash on the IMAP server. After this migration step, you should only have your Chat history in your All Mail folder.
So what can you do with the remaining data on your GMail account? Find out next...




























