Walkthrough: migrate POP to IMAP using Apple Mail
Not really a question but a walkthrough which I hope might be useful to people who need to migrate one (or many) POP3 account(s) to IMAP. Comments welcome.
- Adjust quota on mailbox on server
All your locally stored emails will take place on the server. Make sure you are allowed enough space there to receive them all.
- Create migration folders
Create local mailboxes (folders) for the Inbox messages and Sent messages. And for other mailboxes/folders you might want to migrate to IMAP (Drafts, Deleted, other…)
- Group all messages from your different sources
Move your messages from your POP account to the appropriate migration folders. If you had your POP account setup on different devices, import them all to Apple Mail and move them in the appropriate migration folder.
- Eliminate duplicate messages
If you had your POP account setup on different devices, the step above has most likely created duplicates in the different folders. Apple Mail hides duplicate messages from your view, but the duplicates are there nonetheless. Getting rid of them is easy, though:
- Select all messages from one migration folder
- File Menu - Save As… (the name you want)
This will create a mbox file but with the duplicates removed: just one file per message.
- Import the mbox file
This will be your "clean" migration folder to send to IMAP
- Repeat for each migration folder
- Delete your POP account(s)
Delete your POP account on every device it was setup. You can breathe, you have all your messages in your clean migration folders. Before you do, you could want to backup your mbox file to a thumb drive. You know, just in case 5h!t happened between killing now and having completed the migration.
- On the local computer, create the account using IMAP
Should be empty, except maybe for the INBOX which might have received new emails since your started the whole process. That's ok.
- Create the folders in the IMAP server
If the creation of the account hasn't created a Sent folder, Trash, Drafts, etc…, you can make them easily: write a new mail to yourself, save it as draft, send it, delete it when received. Manually create the other folders you want.
- Migrate!
For each clean migration folder, select all messages, copy* them, and paste them in the corresponding folder in your IMAP account. *I prefer to copy that just move the messages: this allows to confirm that all messages were transferred and to redo the transfer if something went wrong. Copying many messages can take some time, and you will then see a "copying message" progress dialog appear. When progress is completed, you can go in the destination folder and paste the messages. Progress on the transfer will be shown as "Outgoing Messages"
Notes:
In older version(s) of iOS, an IMAP account was showing messages in the order their underlying message file was created. Step 8 above copies emails in reverse order of reception (newer messages first). Then, on an iOS device, the messages were shown with the older messages first, until new messages got in (then showing newly received emails first, then migrated emails from the oldest to the newest) . To get the emails listed in proper order on the iOS device, I had to write an AppleScript to copy the messages in the order they were received. However, this seems to no longer be necessary with iOS 8. I don't know about iOS 7.
Hint:
Before step 8, you might want to mark all your to-be-copied emails as "unread". This speeds counting how many messages are in the clean migration folder, and in the destination folder after the copy. Mark them as "read" after the copy completed.
Hope this helps!
iMac, OS X Mountain Lion (10.8.5)