Moving mail from "On my Mac" to Gmail

I need to salvage a lot of emails that have been stored “On my Mac” to the Gmail IMAP.
Its more then 100K of emails but what makes it worse is the deep folder structure. The folder tree is on average 4 layers deep.
When I drag a folder with sub - sub - sub folders to the Gmail IMAP it will fail.
Only the folders with just emails will move over. So far I can only salvage the emails by creating the folders on Gmail IMAP and copy the content from the local folders. Its an immense time consuming mind numbing task.

I also tried to export the email and import again, did not work.

Further I tried to move the folders in the ~/Library and reindex the mail but that did not work either.

Anyone with a good solution out there?

Unfortunately the mind numbing task is the solution. But since the folders you are creating with your email client will actually just be labels on the Gmail server I suggest you create single level folders to simplify moving the messages. You can relabel your messages later on the server to recreate any structure you desire.

Google, like most/all email services will only accept a certain amount of messages at one time. So when you are copying a large amount your uploads will pause for a time then continue. However, your email client may disconnect so I suggested you keep up with which messages are being moved.

I recently copied around 8000 messages from one Gmail account to the other without a problem but it did take time, To make it easier to keep track of my messages I copied one year’s worth at a time. Good luck.


Yeah I wish I could merge the emails into fewer folders but this client insist in keeping the 500+ folders…

Ah well he pays per hr…