The same limitation applies: Chat messages are not exported to IMAP, so they will not be migrated to Outlook.
This migration follows similar steps to the previous procedure:
1. catalog your GMail items (e.g. their labels)
2. copy over your mail to Outlook
3. apply labels to the Outlook items
4. purge labels that have been successfully migrated from GMail
5. finally, purge messages that have been successfully migrated to and labeled in Outlook. (This step is only possible once there are no more labeled messages; other than in your Trash.)
The trick is that Outlook is only involved in steps 2 and 3, and "cataloging" and "purging" your GMail labels is much faster by contacting the GMail IMAP server directly. This also means that you normally would NOT need to limit your IMAP folder size, as Outlook is not involved in this cataloging step.
Once the labels have been cataloged, you can copy over your messages simply in Outlook. Since your Inbox is always exported to IMAP, and subscribed by Outlook, it may make sense to move all your mail from your Inbox under a different label, similarly how you would replace the trash label.
This script will not import your Trash folder, unless you force it. This is because items purged from the trash will be permanently deleted (as discussed earlier), and during the final purge items will temporarily be moved to the trash so that they can be deleted.
Python Script
The import/conversion script gmail_imap.py code is posted here. You will need to change to the directory where you have saved the script on the command line so that you can run the script.usage: gmail_imap.py [-h] [-f FILE] [-r] [-e EMAIL] [-p PASSWORD] [-I INBOX]
[-T TRASH] [--import-trash] [--final] [--folder FOLDER]
[--limit LIMIT] [--recurse]
{import,purge,apply}
helper script to migrate GMail labels to Outlook Categories
positional arguments:
{import,purge,apply}
optional arguments:
-h, --help show this help message and exit
-f FILE, --file FILE db file to import
-r, --reimport reimport already imported labels
-e EMAIL, --email EMAIL
gmail account name
-p PASSWORD, --password PASSWORD, --pwd PASSWORD
gmail account name
-I INBOX, --inbox INBOX
label used instead of Inbox
-T TRASH, --trash TRASH
label used instead of Trash
--import-trash also import/purge trash
--final purge imported messages
--folder FOLDER Outlook folder where mail was imported to
--limit LIMIT Maximum number of items to purge at one time
--recurse apply labels recursively for messages in all
subfolders
Step-by-step Procedure
1. configure GMail for IMAP access similarly as before, except you can:
- leave Auto-Expunge ON
- should not limit IMAP folder size.
- If you are in a real hurry, also replace the Inbox label with your custom label, similarly how it is done for the Trash label. Basically: select all items and move them under a newly created label.
- DO NOT enable macros; we are using the Python script instead
- only subscribe to the following folders (the last 3 are always subscribed to by Outlook):
- [GMail]/All Mail
- [GMail]/Sent Mail
- Junk E-Mail
- Inbox
3. catalog your GMail items:
- On the Windows command line, run:
gmail-imap.py import - optional flags:
- -e
- otherwise, you are prompted - -p
- otherwise, you are prompted - -I
- if you moved your Inbox under your own label for faster Outlook access to IMAP - -T
- if you want to import labels even for items in your Trash - --import-trash - if you did not relabel your trash, you can force to import the actual trash folder
- -f
- use database file other than default: "gmail_imported.pickle" - NOTE: If you relabeled your Inbox, make sure you supply the name of the new label on the command line. Similarly for Trash.
- This will catalog all labels into the database file.
- NOTE: if the procedure gets interrupted, you can safely rerun the same script
4. copy over your GMail to Outlook
- In Outlook, go to your [GMail]/All Mail folder
- Wait until all message headers have been downloaded
- Select all messages
- Then, copy(!) them to the root of your new PST. (Drag with right-click to the desired location.)
5. apply catalogued labels to the Outlook messages
- On the Windows command line, run:
gmail-imap.py apply --folder - optional flags:
- -f
- use database file other than default: "gmail_imported.pickle" - This will apply the imported labels to any of the messages that have been copied to your PST folder. The path after --folder is actually a backslash separated path in case you have copied your mail to some other subfolder.
- Once the apply is done, a new file will be created. It has the same name as the database file, but a '.remaining' suffix is appended. This file will contain a list messages that have been found in Outlook. Also, this file will contain the labels for any cataloged items that were not found in Outlook, if any, along with a warning message. This warning means that you will need to rerun the apply step later with this newly created file later, to apply any missing labels.
6. purge any labels that have been successfully imported into Outlook
- On the Windows command line, run:
gmail-imap.py purge - optional flags:
- -e
- otherwise, you are prompted - -p
- otherwise, you are prompted - -I
- if you moved your Inbox under your own label for faster Outlook access to IMAP - -T
- if you want to import labels even for items in your Trash - --import-trash - if you did not relabel your trash, you can force to purge the actual trash folder. These messages will be deleted forever.
- -f
- use database file other than default: "gmail_imported.pickle" - --limit 1000 - you can set this limit so that emails are expunged in groups of 1000. This allows you to monitor the process of purging, as expunge can appear to hang when done for the whole folder. Nonetheless, this will slightly slow down you purge process.
- NOTE: If you relabeled your Inbox, make sure you supply the name of the new label on the command line. Similarly for Trash.
- NOTE: do not use the created .remaining file, as you want to remove the labels that you cataloged.
- NOTE: if the procedure gets interrupted, you can safely rerun the same script.
- NOTE: you can run step 6 in parallel with steps 4 and/or 5.
7. Once you think you have imported all labels and messages over, you can try to remove successfully migrated messages from GMail.
- On the Windows command line, run:
gmail-imap.py purge --final -f <.remaining file created during apply> - optional flags:
- -e
- otherwise, you are prompted - -p
- otherwise, you are prompted
- NOTE: this process will terminate if there are any remaining labels that have not been successfully purged in step 6. This means that these labels have not been correctly cataloged in step 3. You have to rerun steps 3-6. If you are worried, use a different database file for safety. This should not be needed, as all correctly cataloged labels should have been removed in step 6, and the copied outlook items will be still valid after step 5.
- NOTE: if the procedure gets interrupted, you can safely rerun the same script.
- NOTE: you CAN NOT run this step in parallel with other steps.
8. If you have remaining items in your All Mail folder, rerun steps 4-7.
- NOTE: You will not be able to copy your Chats as these are not exposed via IMAP. So any Chats will remain in All Mail or under their respective label(s).
9. Reset your Outlook and GMail settings as before.
Notes
1. If you have already copied your mail over, you can use the --recurse flag during apply so that all subdirectories are searched for copied email. Otherwise, only the folder you specify is searched.
2. If you want to limit your PST sizes to 2GB limit, you can copy your messages into separate files. Then run the apply step individually for each PST. Just make sure their display name is unique. (This defaults to "Outlook Data File" by default for a PST, but you can change it if you right click on the PST and select Data File Properties... => Advanced... => Name)
No comments:
Post a Comment