I had a company that want to migrate their workloads to google workspace, coming from a cpanel and a classic email service they want to migrate the whole emails to the new accounts.
I found 2 approach to this kind of work. One is the migration tool of google workspace in the admin console. And another one is imapsync, which I found really good and run very smooth on linux.
For the google workspace migration tool is easy.
- Navigate to Data (or Account)Then select Data import & export
- Finally, choose Data Migration (New)
- For migrating from cPanel, you will select Other IMAP Server as the Migration Source.
- You will then enter the IMAP server address (e.g.,
mail.yourdomain.com) and a role account's credentials from your cPanel hosting to establish a connection.

First you need to create the accounts on the admin console of google workspace. Then on each user enable MFA on each user account.
Second, create a app password.
https://myaccount.google.com/u/2/apppasswords
Downlaod and install imapsync.
https://imapsync.lamiral.info/dist2/
Run imapsync and migrate the folders.
imapsync \
--host1 source.domain.com --user1 source@domain.com --password1 'password' --ssl1 \
--host2 imap.gmail.com --user2 destination@domain.com --password2 'app password' --ssl2 \
--justfolders
Run imapsync with --dry to check if everything will go fine.
imapsync \
--host1 source.domain.com --user1 source@domain.com --password1 'password' --ssl1 \
--host2 imap.gmail.com --user2 destination@domain.com --password2 'app password' --ssl2 \
--dry
Finally, run the migration.
imapsync \
--host1 source.domain.com --user1 source@domain.com --password1 'password' --ssl1 \
--host2 imap.gmail.com --user2 destination@domain.com --password2 'app password' --ssl2
Will migrate everything even the trash.

Conclusion:
Both tools are good, I found only one issue with data migration tool on one account, this was the only issue. If I can choose one, the best for me is imapsync.
Both tools are slow, for an account with 17k emails took about 12 hours to fully migrate.