Moving a company’s mail from a cPanel server to Google Workspace is one of the most common migrations a hosting provider gets asked to handle, and the Data Migration Service built into the Google Admin console does most of the work. It connects to the cPanel server over IMAP as each user, copies messages and folder structure into the matching Gmail account, and can be rerun to pick up anything that arrived in between.
Applies to cPanel 134 or 138 with Dovecot 2.4 to Google Workspace
Table of Contents
Contacts and calendars on cPanel are typically not in scope, since cPanel’s CalDAV and CardDAV data is small and better exported per user. This guide assumes a cPanel 134 or 138 server with Dovecot 2.4 and a Workspace tenant that already has the domain verified.
Short answer: Create the Workspace users first, then in the Admin console open Data migration, choose Email, set the source to Other IMAP server with the cPanel hostname on port 993 and SSL, and either enter each user’s cPanel password or upload a CSV mapping source addresses, passwords and destination accounts. Start the migration, let it run to completion, and on cutover day change the MX records to Google, run the migration again for the delta, and verify a sample of mailboxes.
Prepare the cPanel side
The migration authenticates as each mailbox, so you need every user’s password or you must reset them in cPanel » Email Accounts and share the new ones. Check that IMAP over SSL on port 993 is reachable from the internet and that the server’s certificate matches the hostname you will use; a mismatched certificate causes the connection test to fail. If CSF or Imunify360 protects the server, whitelist Google’s connection sources ahead of time, because dozens of parallel IMAP logins from the same ranges look like a brute-force attempt and get blocked mid-migration.
Raise Dovecot’s per-IP connection limit in WHM » Mailserver Configuration if the migration stalls with connection refused messages. Finally, run the cPanel disk usage report to size each mailbox; anything above several gigabytes will take hours.
Create users and prepare the mapping
Every destination mailbox must exist in Workspace before migration starts. Bulk-create them from the Admin console with a CSV upload or with the GAM tool. Then build the migration CSV with one row per user containing the source email address, the source password and the destination Workspace address:
alice@example.com,SourcePassw0rd!,alice@example.com
bob@example.com,AnotherPassw0rd!,bob@example.com
Keep this file somewhere access-controlled and delete it after the migration. Distribution lists and forwarders on cPanel do not migrate; recreate them as Groups or as forwarding rules in Gmail settings.
Run the Data Migration Service
In the Admin console go to Data migration, choose Email and select Other IMAP server as the source. Enter the cPanel hostname, choose SSL and port 993, and use the connection test with one real mailbox to confirm it works. Set the migration start date if only recent mail is wanted, and choose whether to exclude folders such as spam and trash, which is usually sensible. Upload the CSV or add users one at a time, then start.
The console shows per-user progress and a status; errors typically say authentication failed for a specific user, which is a wrong password in the CSV, or connection errors, which point back at the firewall. Migrated messages keep their dates and folders become Gmail labels with the same names; IMAP flags for read and unread state are preserved.
Cutover and delta run
Two days before cutover lower the domain’s MX TTL to 300 seconds. On the day, remove the cPanel MX records and publish Google’s, then set the domain’s mail routing in cPanel » Email Routing to Remote Mail Exchanger so the server stops accepting delivery locally; a domain left on local routing quietly swallows mail sent from other accounts on the same server. Once MX propagation is confirmed, run the migration again for the same users.
The service only copies messages not already present, so this delta pass catches everything delivered to cPanel between the first run and the MX change. Also publish SPF, DKIM and DMARC for Google before the first message leaves; Workspace generates the DKIM record under Apps » Google Workspace » Gmail » Authenticate email.
Verify
Compare counts for a sample of users by logging in to Gmail and checking the label totals against cPanel’s webmail. On the server, count messages per Maildir folder:
find /home/example/mail/example.com/alice/cur /home/example/mail/example.com/alice/new -type f | wc -l
find /home/example/mail/example.com/alice/.Sent/cur -type f | wc -l
Send a test message to the migrated address from an external account and confirm it arrives in Gmail rather than cPanel. Check the Admin console’s migration report for users with errors and rerun those individually. The common pitfall is the source mailbox containing folder names with characters Gmail labels do not accept, or nested folders beyond Gmail’s depth limits, which appear as skipped items in the report; rename them on the cPanel side and rerun for that user. Keep the cPanel mailboxes intact for at least a month after cutover in case anything was missed.
Migrate cPanel email to Google Workspace at a glance

Official documentation: Google Workspace Admin Help, cPanel & WHM documentation.
Related guides: Transferring accounts between servers with the WHM Transfer Tool · How to upgrade MySQL 8.0 to MariaDB 11.8 in WHM without losing databases · Migrating cPanel accounts to DirectAdmin and the post-migration checklist.
Frequently asked questions
Does the Data Migration Service also migrate contacts and calendars from cPanel?
No. The IMAP source only covers mail. Users export contacts and calendars from cPanel webmail or their client as vCard and iCalendar files and import them into Google Contacts and Google Calendar.
How long does a cPanel to Google Workspace email migration take?
Throughput is typically a few gigabytes per hour per user with many users running in parallel, so a fifty-user company with average mailboxes finishes in a day; very large mailboxes can take several days.
Can I undo the migration and go back to cPanel?
Yes. Point MX records back to the cPanel server and set Email Routing to local; the cPanel mailboxes are untouched by the migration. Mail delivered to Gmail in the meantime would need exporting with Google Takeout or an IMAP copy.
Maintenance record
This guide changes servers, data or security settings, so we re-check it against current versions on a fixed schedule. Take a backup or snapshot before you start.
- Maintained by
- srvScripts editorial team
- Supported versions
- cPanel 134 or 138 with Dovecot 2.4 to Google Workspace
- Last full review
- Next review