Why Migrate from cPanel?
cPanel license costs have increased significantly, with prices starting at $15/month for a single account. For many users, migrating to a free panel (HestiaCP, CloudPanel) or a bare server setup provides the same functionality at a fraction of the cost.
Export from cPanel
# Method 1: Full account backup via cPanel
# Login to cPanel > Backup > Download Full Website Backup
# Method 2: WHM command line (all accounts)
for user in $(ls /var/cpanel/users/); do
/usr/local/cpanel/scripts/pkgacct "$user" /backup/
done
# Method 3: Manual selective export
# Website files:
tar czf /backup/sites.tar.gz /home/*/public_html/
# All MySQL databases:
mysqldump --all-databases --single-transaction \
--routines --triggers > /backup/all-databases.sql
# Email (Maildir format):
tar czf /backup/email.tar.gz /home/*/mail/
# DNS zones:
tar czf /backup/dns.tar.gz /var/named/*.db
# SSL certificates:
tar czf /backup/ssl.tar.gz /etc/ssl/certs/ /etc/ssl/private/
# Cron jobs:
for user in $(ls /var/cpanel/users/); do
crontab -u "$user" -l > "/backup/cron-$user.txt" 2>/dev/null
done
Import to HestiaCP
# HestiaCP has a built-in cPanel importer
v-import-cpanel /backup/cpmove-username.tar.gz
# This imports websites, databases, email, DNS, and cron jobs
# Verify each site after import
Import to Bare Server (No Panel)
# 1. Install web server stack
sudo apt install -y nginx mysql-server php8.3-fpm certbot
# 2. Create directory structure
mkdir -p /var/www/example.com/public_html
# 3. Extract website files
tar xzf /backup/sites.tar.gz
cp -r /home/username/public_html/* /var/www/example.com/public_html/
chown -R www-data:www-data /var/www/example.com
# 4. Import database
mysql -u root < /backup/all-databases.sql
# 5. Create Nginx virtual hosts for each site
# 6. Install SSL with certbot
# 7. Set up cron jobs manually
# 8. Migrate email to dedicated service or self-hosted solution
DNS Migration
# Export zone files from cPanel/WHM
# Import to Cloudflare or new DNS provider
# Critical records: A, MX, TXT (SPF, DKIM, DMARC), CNAME
# Lower TTL 24h before, update after verification
Email Migration
# Use imapsync for mailbox-to-mailbox migration
imapsync --host1 old-cpanel --user1 user@domain.com --password1 pass \
--host2 new-server --user2 user@domain.com --password2 pass --ssl1 --ssl2
# Or migrate to external email (Google Workspace, Zoho, Migadu)
Post-Migration
- Verify all sites load correctly with HTTPS
- Test email sending and receiving
- Verify database connections in application configs
- Set up automated backups
- Cancel cPanel license after confirmation