IMAP → Google Workspace Migration Guide
Migrate email from any IMAP-compatible mail server into Google Workspace Gmail. This route works with cPanel/Plesk-hosted mail, Dovecot, Cyrus, Kerio, MDaemon, and any other IMAP server. Only email is migrated — IMAP does not carry calendar or contact data.
Prerequisites
Source mail server
- IMAP access enabled on port 993 (SSL) or port 143 (STARTTLS)
- Either an admin/master account with proxy access to all mailboxes, or individual credentials for each user
- Firewall allows outbound connections from the Aatrex host to your IMAP server
Destination — Google Workspace
- Super Administrator role
- Google Workspace licences assigned to all destination users
- All destination Gmail accounts must already exist before migration starts
Step 1: Set Up Google Workspace Destination
1a. Create a Google Cloud Project
- Sign in to console.cloud.google.com as a Super Administrator.
- Click Select a project → New Project, name it
Aatrex IMAP Migration, and click Create. - Go to APIs & Services → Library and enable:
- Gmail API
- Admin SDK API
1b. Create a Service Account
- Go to APIs & Services → Credentials → Create Credentials → Service account.
- Name it
aatrex-imap-migrationand click Create and Continue → Done. - Click the service account → Keys tab → Add Key → Create new key → JSON. Save the JSON file.
- Copy the Unique ID (numeric string) from the service account detail page.
1c. Grant Domain-Wide Delegation
- In the Google Admin console (admin.google.com), go to Security → Access and data control → API controls → Manage domain-wide delegation.
- Click Add new and enter:
- Client ID: the service account Unique ID
- OAuth Scopes:
https://mail.google.com/, https://www.googleapis.com/auth/admin.directory.user.readonly
- Click Authorise.
Step 2: Create a Migration Project
- In Aatrex, click Projects → Create Project.
- Select IMAP → Google Workspace as the migration type.
- On the Source credentials step:
- Connection type: IMAP
- Host: your IMAP hostname (e.g.
mail.yourtenant.com) - Port: 993 (SSL recommended)
- Authentication: Admin account if your server supports master credentials, or Per-user credentials if not
- On the Destination credentials step:
- Upload the Google service account JSON key file
- Enter the Admin email — a Super Administrator UPN. The service account impersonates this user to write mail into destination Gmail accounts.
- Click Test Connection → Save Project.
Step 3: Add Users
Option A — Admin Account Mode (auto-discover)
If your IMAP server supports master credentials:
- Click Scan → Discover Users. Aatrex queries the IMAP server for all available mailboxes.
- Click Auto Map to match source to destination Gmail addresses by username.
Option B — Per-User Credentials Mode (CSV import)
If your server does not support admin proxy access:
- Prepare a CSV file — no header row, three columns:
source_email,source_password,destination_gmail john.smith@oldmail.com,P@ssw0rd123,john.smith@yourtenant.com alice.jones@oldmail.com,S3cretPass,alice.jones@yourtenant.com - In your project, click Scan → Import Users and upload the CSV.
- Aatrex validates each credential against the IMAP server and flags any that fail authentication.
Step 4: Start Migration
- Select users and click Migrate.
- Choose a mode:
- Full — migrates all folders and messages, preserving folder hierarchy and read/unread status.
- Date range — migrates messages received after a specified date. Use for incremental pre-cutover passes.
- Click Start Migration.
Tip: Run a full migration pass several days before MX cutover, then run a date-range incremental pass in the final 24–48 hours to capture mail received during migration.
Step 5: MX Record Cutover to Google
When all users are migrated and the final incremental pass is complete:
- Update your domain's MX record to:
Priority 1: ASPMX.L.GOOGLE.COM Priority 5: ALT1.ASPMX.L.GOOGLE.COM Priority 5: ALT2.ASPMX.L.GOOGLE.COM - Add or update SPF:
v=spf1 include:_spf.google.com ~all - Enable DKIM signing in the Google Admin console: Apps → Google Workspace → Gmail → Authenticate email → Generate new record → Start authentication.
- Lower MX TTL to 300 seconds at least 48 hours before cutover for fast propagation.
What Is and Is Not Migrated
| Item | Migrated |
|---|---|
| Email messages (all folders) | ✅ Yes |
| Read / unread status | ✅ Yes |
| Message timestamps | ✅ Yes |
| Folder hierarchy | ✅ Yes |
| Calendars | ❌ No — IMAP does not carry calendar data |
| Contacts | ❌ No — IMAP does not carry contact data |
| Mail rules and signatures | ❌ No — must be recreated manually in Gmail |
| Folder permissions / delegates | ❌ No — not supported via IMAP |
See What Moves and What Doesn't for every path.
Common Issues
IMAP connection refused Confirm port 993 is open from the Aatrex host to your mail server. Some hosting providers (cPanel, Plesk) block IMAP access from non-listed IPs — check your firewall or hosting control panel.
All user credentials fail
If using admin/master credentials, verify the format your server requires. cPanel uses user@domain.com+adminpassword style logins; Plesk typically uses user@domain.com with the reseller password. Consult your hosting panel documentation.
Gmail API quota exceeded Google limits Gmail API write operations per day per service account. For organisations over 200 users, contact Google Support to request a quota increase before migration. Aatrex automatically backs off when quota errors are returned and retries after the quota window resets.
Folders appear flat after migration
Some IMAP servers export subfolders with dots (.) rather than slashes as the hierarchy separator. Aatrex detects the separator automatically, but if labels appear incorrectly flattened, contact Aatrex support with the raw folder list from your server.