Moving from shared cPanel webmail hosting to Microsoft 365? Learn how to migrate Roundcube/Horde mailboxes directly to M365 tenants with full OAuth 2.0 PKCE.
On This Page (10 sections) ▾
- 1. Pre-Migration Checklist: Gathering Server Parameters
- 2. The Critical Gotcha: cPanel Email Routing (Local vs. Remote Exchanger)
- 3. Method 1: Direct Cloud-to-Cloud Automated Streaming (Live Background Sync)
- 4. Method 2: Native Microsoft 365 EAC IMAP Migration Batch
- 5. Shared Mailboxes: Saving Microsoft 365 Licensing Fees
- 6. Post-Migration: Switching DNS MX, SPF, and DKIM Records
- 7. Method 3: Manual Export via Roundcube Webmail (Single Mailbox Fallback)
- 8. Migration Architecture Comparison
- 9. Frequently Asked Questions
- 10. Summary & Next Steps
Quick Answer (Migrating cPanel Webmail to Microsoft 365):
Exporting mailboxes larger than 2GB through Roundcube triggers PHP 300s socket timeouts. To migrate cleanly to Microsoft 365:
- Direct IMAP Sync: Run Prism IMAP Backup Tool connecting to cPanel on Port 993 (SSL), exporting directly to PST or streaming to M365 via Modern Auth.
- Exchange Admin Center (EAC): In Microsoft 365 admin center, create an IMAP migration batch using CSV mapping (
EmailAddress,UserName,Password). - Lower TTL 48h Ahead: Drop DNS MX/SPF TTL to 300 seconds before cutover to ensure minimal propagation delay during domain transfer.
Upgrading shared cPanel webmail hosting (Roundcube or Horde) to Microsoft 365 (Exchange Online) forms the backbone of countless corporate IT modernization projects.
Executing a clean migration without dropping messages or creating extended MX record downtime requires structured preparation.
┌────────────────────────────────┐ ┌────────────────────────────────┐
│ cPanel Webmail Server │ ───> │ Microsoft 365 Cloud │
│ (Roundcube / Maildir Storage) │ │ (Exchange Online Primary / │
│ Port 993 (SSL) │ │ In-Place Online Archive) │
└────────────────────────────────┘ └────────────────────────────────┘Here is a practical guide to streaming single mailboxes or multi-user cPanel domains straight into Exchange Online.
Pre-Migration Checklist: Gathering Server Parameters
Gather your cPanel connection parameters before beginning:
- cPanel Server Hostname:
mail.yourdomain.comorserverXX.web-hosting.com - IMAP Port:
993(SSL/TLS enforced) - Authentication: Standard cPanel email address and mailbox password
- Microsoft 365 Tenant: Admin access with Exchange Administrator privileges
The Critical Gotcha: cPanel Email Routing (Local vs. Remote Exchanger)
A common challenge during cPanel to Microsoft 365 cutovers occurs with website contact forms and automated billing scripts running on the same cPanel server.
By default, cPanel sets Email Routing to Local Mail Exchanger. When a contact form on your WordPress site sends an email to sales@yourdomain.com, the local Exim mail transfer agent sees that the domain exists locally and drops the message into the local cPanel inbox, bypassing your new Microsoft 365 MX records.
How to Fix in cPanel:
- Log into your cPanel Dashboard.
- Navigate to Email > Email Routing.
- Select your domain.
- Change the routing setting from Automatically Detect Configuration or Local Mail Exchanger to Remote Mail Exchanger.
- Click Change.
This forces the local server to route all outgoing emails through external public DNS, ensuring inquiries reach Microsoft 365.
Method 1: Direct Cloud-to-Cloud Automated Streaming (Live Background Sync)
For multi-mailbox deployments, staging through local PST files can be time-consuming. Using the Prism IMAP Backup Tool streams mailboxes directly to Microsoft 365 without saving intermediate files to disk:
┌───────────────────────────┐ ┌──────────────────────────────┐ ┌───────────────────────────┐
│ cPanel Host Server │ ───> │ Prism IMAP Stream Relay │ ───> │ Microsoft 365 Tenant │
│ (mail.domain.com:993) │ │ (Multi-Threaded REST Stream)│ │ (Direct M365 Mailboxes) │
└───────────────────────────┘ └──────────────────────────────┘ └───────────────────────────┘- Launch the migration engine, select cPanel / Webmail, and enter
mail.yourdomain.comalong with a CSV list of user credentials for batch runs. - Select Microsoft 365 as the destination and authenticate via Microsoft Graph OAuth 2.0 PKCE.
- Map each cPanel account to its target M365 user or Shared Mailbox.
- Click Migrate to stream messages, nested folders, and attachments directly into Exchange Online.
Free Trial Evaluation: The demo edition migrates up to 50 items per folder, allowing administrators to verify connection parameters, OAuth 2.0 authentication, and folder mapping before licensing.
Method 2: Native Microsoft 365 EAC IMAP Migration Batch
The built-in Exchange Admin Center (EAC) gives administrators a native IMAP engine.
Log into the Exchange Admin Center (https://admin.exchange.microsoft.com). Head into Migration > Endpoints > Add Endpoint, pick IMAP, name it cPanel-Endpoint, and set the server to mail.yourdomain.com on port 993 using Basic auth and SSL encryption.
Build a CSV file named cpanel_users.csv structured like this:
EmailAddress,UserName,Password
john.doe@company.com,john.doe@company.com,UserPassword123!
jane.smith@company.com,jane.smith@company.com,UserPassword456!Head to Migration > Add Migration Batch inside EAC, upload that CSV, pick your endpoint, and start the job. Keep an eye on the dashboard until every mailbox hits the Synced status.
Limitations of Native EAC IMAP Sync:
- Does not migrate contacts or calendars.
- Microsoft throttles third-party IMAP endpoints to ~1GB per hour per mailbox.
- If passwords fail or change during cutover, the entire batch halts.
Shared Mailboxes: Saving Microsoft 365 Licensing Fees
When migrating generic addresses like info@company.com, billing@company.com, or support@company.com, do not purchase expensive $6 to $22/month user licenses.
In Exchange Online, Shared Mailboxes do not require a separate user license up to 50 GB of storage:
# Create a free shared mailbox for generic departmental accounts
New-Mailbox -Shared -Name "Billing Inquiries" -PrimarySmtpAddress billing@company.com
# Grant members full access to open the mailbox alongside their personal inbox
Add-MailboxPermission -Identity billing@company.com -User admin@company.com -AccessRights FullAccess -InheritanceType All
Add-RecipientPermission -Identity billing@company.com -Trustee admin@company.com -AccessRights SendAsDuring migration in the Prism engine, target these shared mailboxes directly to ingest historical cPanel archives without consuming paid licenses.
Post-Migration: Switching DNS MX, SPF, and DKIM Records
Cutover time arrives once the baseline sync finishes.
Lower your DNS Time-to-Live (TTL) down to 300 seconds a full day beforehand.
Point your domain's MX Record squarely at Microsoft 365:
Priority: 0
Host: @
Points to: yourdomain-com.mail.protection.outlook.comPatch up your SPF entry to authorize Microsoft 365 mail servers:
v=spf1 include:spf.protection.outlook.com -allConfigure DKIM by adding Microsoft 365 selector CNAMEs in your cPanel Zone Editor:
selector1._domainkey.yourdomain.com CNAME selector1-yourdomain-com._domainkey.tenant.onmicrosoft.com
selector2._domainkey.yourdomain.com CNAME selector2-yourdomain-com._domainkey.tenant.onmicrosoft.comRun one final delta sync to sweep up any stray messages that landed during DNS propagation.
Method 3: Manual Export via Roundcube Webmail (Single Mailbox Fallback)
If you are only migrating a single mailbox or an executive user who cannot share their password, you can export directly from the Roundcube web interface:
- Log into your cPanel Webmail (
https://yourdomain.com:2096) and open Roundcube. - Click on the folder you need (e.g., Inbox).
- Select the messages you wish to download (or click Select All).
- Click the More icon (three dots) in the top action toolbar and choose Download (.eml) or Download as .zip.
- To export an entire folder as an MBOX file, click the Folder Actions gear icon at the bottom of the folder list and select Export folder.
Once downloaded, import the resulting .eml or .mbox files into Microsoft Outlook or batch convert them using the EML Converter Tool.
Migration Architecture Comparison
| Feature / Capability | Prism Direct Stream Relay | Native EAC IMAP Batch | Manual Roundcube Export |
|---|---|---|---|
| Speed / Throughput | Multi-threaded Streaming | Throttled by M365 (~1 GB/hr) | Manual, folder-by-folder |
| Authentication | Modern OAuth 2.0 PKCE | Basic Auth (Plaintext CSV) | Web Session Cookie |
| Preserves Folder Tree | Yes (Exact nested hierarchy) | Flat or partial subfolders | No (Requires re-sorting) |
| User Password Handling | Secure token / Admin relay | Requires cleartext user passwords | Handled by user |
| Downtime Impact | Minimal (Pre-cutover sync) | Low (DNS cutover required) | High manual overhead |
Frequently Asked Questions
Will migrating cPanel webmail delete my original emails from the hosting server?
No. The migration processes read message streams via IMAP port 993 and duplicate them into Exchange Online. Original messages remain untouched on your cPanel server until you choose to terminate your hosting package.
How do I handle cPanel email addresses that don't match Microsoft 365 usernames?
Map them using a migration mapping CSV. For example, assign info@yourdomain.com on cPanel to an Exchange Online Shared Mailbox so you don't burn an expensive Microsoft 365 Business license on a generic alias.
Why does native EAC IMAP migration fail with timeout errors on cPanel?
Most shared web hosts (GoDaddy, Bluehost, Hostinger) enforce strict connection concurrency limits per IP address (often capping connections at 10 simultaneous IMAP sessions in dovecot.conf). Microsoft's cloud servers flood the host with connections, triggering a temporary IP ban.
How do I migrate Roundcube calendars and address books to Microsoft 365?
IMAP only synchronizes emails. To move Roundcube contacts and calendars, go into Roundcube Contacts > Export (vCard .vcf), and Calendar > Export (.ics). Import these files directly into the user's Outlook Web App (OWA).
What happens to email forwarders created in cPanel?
cPanel forwarders do not transfer automatically over IMAP. Recreate required forwarding rules in Microsoft 365 Admin Center under Mail flow > Rules or by adding email aliases directly to the appropriate user mailboxes.
Summary & Next Steps
Migrating cPanel webmail over to Microsoft 365 gives your organization enterprise high availability, shared mailbox collaboration, and modern spam filtering.
- Use the Prism IMAP Backup Tool to stream mailboxes cleanly to Microsoft 365 without timeouts.
- Need to convert offline cPanel Maildir files directly to PST? See our cPanel Maildir to PST Guide.
Related Guides: Migrating raw Linux mail directories? See How to Convert cPanel Maildir to Outlook PST. Calculate total cloud transfer times with our Mailbox Size Calculator.
IMAP Backup Tool
Backup, convert, export, and migrate any IMAP mailbox — cPanel, Gmail, Yahoo, Zoho, Zimbra, Exchange — to local and cloud formats (PST, PDF, MBOX, EML, Office 365, Gmail). Standalone 64-bit engine with SQLite resume, Port 993 SSL/TLS, and zero Outlook required. Free trial for Windows 11 & Mac.