EDBMails is now NOT RECOMMENDED. It now does not perform as it should, with folders marked for migration missed entirely in the target account, and some folders logged as migrated (with correct message counts) but target folders are empty.
I have left the following in place, but my review summary for EDBMails has changed to STRONGLY NOT RECOMMENDED.
Another shameless plug, this time for a migration product (I get nothing for reporting this, have no financial interest in the product): I got tired of trying to get support from Bittitan while Microsoft changed the back-end rules, and needed to make appointments with Transend to try and get support. This is a breeze by comparison, support-wise. The pricing is super-attractive. And it works. So here goes...
I have successfully used EDBmails (edbmails.com) to migrate users between servers. Haven't used it with gmail but have used it for IMAP on SmarterMail and iMail mailboxes --> Microsoft 365. Really cheap per user and excellent 24x7 live chat support, which is free with the product.
Definitely a bit of a learning curve but once in operation, it's been bulletproof in terms of what it migrates. Windows app, can be installed on multiple computers and run simultaneously. You pay per user. For example, 100 users is currently $200 ($2/ea.) - more per user when you buy fewer licenses - and can do as many full/incremental migrations as you like per user. Lifetime license for each user migrated, and free upgrades. Also migrates IMAP to pst files.
You also get a good idea of progress during migration, something I've found lacking elsewhere.
Other migration types/products listed on their site.
BTW this is NOT a dig at SmarterMail, as all environments I've migrated have kept their on-premises server in a split-domain arrangement with Microsoft 365. Migrations were done in accordance with customer requirements for some users.