Moving off shared cPanel hosting usually happens for one of three reasons: the site has outgrown the resource limits, the host keeps suspending it for CPU usage, or you want control over PHP versions, caching and security. A VPS fixes all three, but a careless move can take the site offline, lose email, or break checkout.
This guide is the order we follow so visitors never see the switch.
What you need before you start
- cPanel access with SSH. Most hosts enable SSH on request. Without it you can still use the Backup Wizard, but it is slower.
- A VPS with at least the RAM and disk your sites use today, plus headroom. Ubuntu 24.04 LTS or Debian 12 are good defaults.
- Access to your DNS. Know where your domain's DNS is actually hosted. It might be your registrar, Cloudflare, or the cPanel host itself.
- A list of everything the account does. Websites, databases, mailboxes, forwarders, cron jobs, SSL certificates, subdomains and any custom PHP settings.
That last list is where most migrations go wrong. Write it down from the cPanel dashboard before you touch anything.
Step 1: Lower the DNS TTL a day early
TTL (time to live) tells resolvers how long to cache your DNS records. If it is set to 14400 (4 hours) or 86400 (24 hours), some visitors will keep reaching the old server for that long after you switch.
Change the TTL of your A, AAAA and www records to 300 seconds at least 24 hours before the move. Check it took effect:
dig +noall +answer yourdomain.com A
The second column is the TTL. Once it shows 300 or less, a change will reach almost everyone within five minutes.
If the DNS zone is hosted by the cPanel host, move DNS to an independent provider such as Cloudflare first. Otherwise you lose control of DNS the moment you cancel the old hosting.
Step 2: Build and secure the VPS
Set up the server fully before copying any data. On Ubuntu or Debian:
apt update && apt upgrade -y
adduser deploy && usermod -aG sudo deploy
ufw allow OpenSSH && ufw allow 80,443/tcp && ufw enable
Then:
- Add your SSH key for the new user, and set
PasswordAuthentication noandPermitRootLogin noin/etc/ssh/sshd_config. - Install the web stack: Nginx or Apache, the same PHP major version the site runs today (check it in cPanel under MultiPHP Manager), and MariaDB or MySQL.
- Install the PHP extensions the site needs. For WordPress that is usually
mysql,curl,gdorimagick,mbstring,xml,zipandintl. - Turn on automatic security updates with
unattended-upgrades, and installfail2ban.
Match the PHP version first and upgrade later. Changing hosting and PHP version in the same step makes it hard to tell which one broke something.
Step 3: Copy the files with rsync
From the VPS, pull the files straight from the cPanel account over SSH:
rsync -avz --progress -e "ssh -p 22" \
cpaneluser@old-server-ip:public_html/ /var/www/yourdomain.com/
Replace 22 with your host's SSH port; some shared hosts use a different one. Addon domains and subdomains usually live in their own folders next to public_html, so copy those too.
rsync only sends changed files, so you can run the same command again at the end and it finishes in seconds.
Fix ownership after the copy:
chown -R www-data:www-data /var/www/yourdomain.com
Step 4: Move the database
Export on the old server. --single-transaction takes a consistent copy without locking a live InnoDB database:
mysqldump --single-transaction --routines --triggers \
-u cpaneluser_dbuser -p cpaneluser_dbname > site.sql
Create the database and user on the VPS, then import:
CREATE DATABASE site_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'site_user'@'localhost' IDENTIFIED BY 'a-long-random-password';
GRANT ALL PRIVILEGES ON site_db.* TO 'site_user'@'localhost';
mysql -u site_user -p site_db < site.sql
Update the database name, user and password in the site's config, for example wp-config.php. cPanel prefixes database names with the account name, so they will not match unless you recreate them identically.
If the file path changed (for example from /home/cpaneluser/public_html to /var/www/yourdomain.com), search the database and config files for the old path. On WordPress:
wp search-replace '/home/cpaneluser/public_html' '/var/www/yourdomain.com' --all-tables --dry-run
Remove --dry-run once the output looks right. Don't replace the domain name: it stays the same.
Step 5: Recreate the web server config and SSL
Create a virtual host for each domain. cPanel's .htaccess rules still work if you use Apache. With Nginx you need to translate them, especially redirects and WordPress permalinks:
location / {
try_files $uri $uri/ /index.php?$args;
}
You can't get a Let's Encrypt certificate over HTTP until DNS points at the VPS. Two ways around it:
- Use a DNS challenge (
certbot certonly --manual --preferred-challenges dns, or a DNS plugin for your provider) to issue the certificate before the switch. - If the domain is behind Cloudflare's proxy, use a Cloudflare Origin Certificate on the VPS and keep SSL mode on Full (strict).
Either way, HTTPS works the moment traffic arrives.
Step 6: Test the new server before anyone else sees it
Point only your own computer at the VPS by editing your hosts file (/etc/hosts on Mac and Linux, C:\Windows\System32\drivers\etc\hosts on Windows):
203.0.113.10 yourdomain.com
203.0.113.10 www.yourdomain.com
Now your browser loads the VPS while everyone else still uses cPanel. Check:
- Every page type loads, including posts, categories, search and 404 pages.
- Log in to the admin area and save something.
- Submit every contact form and confirm the email arrives.
- If it is a shop: add to cart, check out with a test payment, and check the order email.
- Images and uploads load, and there are no mixed-content warnings.
- The PHP error log is empty:
tail -f /var/log/nginx/error.logor the PHP-FPM log.
Remove the hosts-file lines when you're done.
Step 7: Don't forget email and cron jobs
Email is the part most often lost. cPanel mailboxes live on the old server. Choose where they go before the switch:
- Move to Google Workspace or Microsoft 365. Create the mailboxes, copy old mail over IMAP (both offer migration tools, or use
imapsync), then change the MX records. - Keep email at the old host for now. Leave the MX records pointing there and only move the website. This is a valid choice if you're keeping the cPanel plan anyway.
Whatever you choose, also check SPF, DKIM and DMARC records. If the website sends mail (contact forms, order emails), send it through an SMTP service such as Amazon SES, Postmark or Resend instead of the VPS directly. Mail from a fresh VPS IP often lands in spam.
Cron jobs are listed under Cron Jobs in cPanel. Recreate each one on the VPS with crontab -e, updating the paths. For WordPress, replace wp-cron.php page-load triggers with a real cron job:
*/5 * * * * cd /var/www/yourdomain.com && wp cron event run --due-now >/dev/null 2>&1
Step 8: Final sync and DNS switch
Pick a quiet time for your audience. Then:
- Freeze changes. Put the old site in maintenance mode if it takes orders or comments, so nothing is written to the old database after the final export.
- Run the final sync. Re-run the rsync command from step 3, then dump and import the database again.
- Switch DNS. Change the
A(andAAAA, if used) records to the VPS IP. - Watch both servers. Tail the access logs on the VPS to see traffic arrive, and the old server's logs to see it fade.
tail -f /var/log/nginx/access.log
With a 300-second TTL, most traffic moves within minutes. If something breaks, change the DNS back. The old server still has everything.
Step 9: After the move
- Keep the cPanel account for at least 7 days. Some resolvers ignore low TTLs, and you may find a missed file or mailbox.
- Set up backups on the VPS that are stored off the server, and test a restore. Shared hosts often back up for you; a VPS doesn't.
- Add uptime and disk monitoring, so you hear about a full disk or a crashed service before customers do.
- Raise the TTL back to 3600 or higher once you're sure you won't need to switch back.
- Check Search Console for crawl errors over the following week.
When to get help
A single brochure site is a reasonable DIY project if you're comfortable with SSH. Get help if the account holds many sites, active email, a shop that takes payments, or custom server software, or if you don't want to be the person patching the server at 2 a.m. afterwards.
We move cPanel accounts to AWS, DigitalOcean, Hetzner and other VPS providers with the steps above, then keep the server patched, backed up and monitored. See cloud server management and Linux server management, or send us your current setup for a quote.

