How to reliably migrate emails from Mac Mail to Google mail? A client has Google Mail on their Mac Mail app. All their emails have been stored within folders in the "On My Mac" section, so the emails were being removed from the Google mailbox. The mailbox is 11GB. Their internet connection is around 40/20Mb.

They now want their emails put back on Google Mail.

The client had started to move some of the 100+ folders themselves, but noticed that the message count would first appear to be correct, but then it would lose about 15 emails or so in every folder. 

That issue seemed to have resolved itself, so now we tried to copy all 100+ folders over to Google, but then it says an error that a folder already exists and it stops. This is odd as previously, it seemed to just merge existing folders. So now I'm trying one folder at a time. Mac Mail shows that the emails are on Google, but when I go to Google Mail on the browser and check the folder, it is empty. 

Is there a better way to migrate the emails? We've spent 4+ hours on this already and Apple were unable to help with it. 

Edit: This is a nightmare! After copying all the folders again, Google place all the emails in the "Drafts" folder on Google mail, but on Mac Mail, it doesn't show them there at all.
I think that the main Issue is the Import process into Gmail which has several restrictions, f.e. Bandwidth-Limitations, and automated functions, f.e. automated filtering, labeling and sorting.

First of all, with 11GB of mail you need Patience!!!! 

Google Infrastructure has a bandwidth-Limitation on Traffic, see Google Support here for details. As mentioned there, 500MB IMAP Upload/per Day is not much and considering the amount you are planning to upload will result in quite some Migration Time.

Another point would be the rebuild and reindexing of the Apple Mail Mailboxes, see the Apple Support page here. Only the you can be (reasonably) sure that the Mailcount is correct.

Another Recommendation: While Migrating, make sure that the Account is not in use by other Clients!!!! There are several Issues in which multiple access to an IMAP Account can result in conflicting operations and filtering. 

Also, try not to repeat the same procedure to often - Google has a limitation there (see earlier mentioned Support page from Google)

That's all very general, but i think you should be aware of the limitations first before planning and executing a Migration of that scale. Letting your Client start something like that and trying to fix the Problems resulting from 'simply copying mails' does not work on that scale.