📞 🇺🇸 +1 361 304 4309 📞 🇮🇳 +91 76769 02281 ✉️ [email protected]
Email Servers

How to Migrate Email Server from cPanel to Mailcow

How to Migrate Email Server from cPanel to Mailcow

Migrating from cPanel email to Mailcow involves transferring mailboxes, historical emails and DNS settings. Done correctly, downtime can be under 30 minutes.

Migration Plan

  1. Set up Mailcow on new server
  2. Create all mailboxes in Mailcow
  3. Sync emails via IMAP using imapsync
  4. Lower MX TTL to 300
  5. Update MX records to new server
  6. Run final imapsync to catch new emails

Step 1 — Install imapsync

sudo apt install imapsync -y

Step 2 — Create Mailboxes in Mailcow

Mailcow Admin → Mailboxes → create each mailbox that exists in cPanel

Step 3 — Sync Emails

# Sync single mailbox
imapsync   --host1 old.cpanelserver.com   --user1 [email protected]   --password1 "oldpassword"   --host2 mail.yourdomain.com   --user2 [email protected]   --password2 "newpassword"   --ssl1 --ssl2   --syncinternaldates

Step 4 — Bulk Migration Script

#!/bin/bash
# Add your mailboxes here
MAILBOXES=(
  "[email protected]:oldpass:newpass"
  "[email protected]:oldpass:newpass"
)

for MB in "${MAILBOXES[@]}"; do
  USER=$(echo $MB | cut -d: -f1)
  PASS1=$(echo $MB | cut -d: -f2)
  PASS2=$(echo $MB | cut -d: -f3)

  imapsync     --host1 old.cpanelserver.com --user1 $USER --password1 $PASS1 --ssl1     --host2 mail.yourdomain.com  --user2 $USER --password2 $PASS2 --ssl2     --syncinternaldates --nofoldersizes
done

Step 5 — Switch MX Records

# Lower TTL 24 hours before
yourdomain.com MX 10 mail.yourdomain.com  # new server

# Run imapsync one more time after DNS switch
# to catch emails received during transition

Conclusion

Email migrations require careful planning to avoid data loss. Our team handles complete email server migrations with zero message loss guaranteed.

#cpanel #mailcow #migration #email #imap
Share this guide:
🛠️ Need Expert Help?

Don't want to do this yourself?

Our certified engineers implement this for you — correctly, securely, and within hours. Available 24/7 with 15-minute emergency response.

  • ✅ 19+ years experience
  • ✅ 60+ certified engineers
  • ✅ 1,600+ servers managed
  • ✅ 40+ countries served
  • ✅ Plans from $49/mo

Get Expert Help — Free Consultation

We respond within 4 hours · No commitment required

Please enter your name and a valid email.

No spam. Privacy Policy

Comments