
Hosting moves fail in familiar ways. DNS flips too early. Email keeps landing on the old box. Someone “fixes SSL” and breaks redirects.
This hosting migration setup guide tutorial walks you through a cPanel-to-cPanel migration to a new VPS. You’ll use a rollback plan, keep email working, and do a controlled DNS switch.
You’ll run a handful of practical checks first (TTL, hostname, rDNS/PTR, AutoSSL status). Then you’ll move data with WHM tools and validate the site before anyone hits the new server.
This workflow fits one business site or a small batch of client accounts.
Hosting migration setup guide tutorial: what you’re migrating (and what you’re not)
Before you touch DNS, define the scope. In cPanel, a “website” is more than files.
Most accounts include databases, cron jobs, DNS zones, mailboxes, SSL, and third-party services that care about IPs.
- Web: /home/USER/public_html, .htaccess, PHP settings, WordPress configs.
- Databases: MySQL/MariaDB + users and grants.
- Email: mailboxes, forwarders, filters, DKIM keys, outbound routing reputation.
- DNS: A/AAAA, MX, TXT (SPF/DMARC), CNAMEs, and nameserver delegation if you host DNS.
- SSL: AutoSSL/Let’s Encrypt status, forced HTTPS redirects, HSTS considerations.
If you need a destination VPS where you control WHM, IPs, and headroom during copy and verification, start with a HostMyCode VPS. If you’d rather have someone handle the production cutover details, managed VPS hosting is the practical choice.
Prerequisites and a quick risk checklist
Do these checks first. They prevent the “migration finished, but everything is off” class of problems.
Minimum requirements
- Source server: WHM root access (or reseller with permission to generate full backups).
- Destination VPS: WHM root access, matching or newer cPanel/OS stack.
- Domain registrar login (to change nameservers or DNS records).
- Ability to lower DNS TTL at least a few hours ahead.
Pre-migration risk checklist (10 minutes)
- Disk space: destination must have enough space for full account backups plus overhead (plan for 1.5× the account size).
- PHP versions: note what each domain uses (MultiPHP in WHM). Keep parity to avoid fatal errors.
- Outgoing email: if the IP changes, you may need reverse DNS and SPF updates or mail will get flagged.
- HSTS: if the domain has HSTS preloading or long max-age, you must ensure valid SSL on the new server before cutover.
- DNS hosting: identify whether DNS is at the registrar, Cloudflare, a cPanel cluster, or the source server.
If you’re using a cPanel DNS cluster, read this cPanel DNS cluster setup tutorial first.
Changing DNS architecture mid-migration is how zones get overwritten.
Step 1: Prepare the destination VPS (hostname, resolver, firewall, time)
Start with the basics on the destination server. If these are wrong, you’ll notice it later.
Most problems show up in mail deliverability and SSL validation.
1) Set a proper hostname and verify it resolves
In WHM: Networking Setup → Change Hostname. Use something like server1.yourdomain.com.
From SSH on the destination:
hostnamectl
hostname -f
Confirm DNS for the hostname points to the destination IP:
dig +short A server1.yourdomain.com
2) Confirm time and NTP
Certificate validation and some API integrations can fail if server time drifts.
timedatectl status
3) Open only what you need (and don’t block migration tools)
If you run CSF, make sure SSH (22), HTTP/HTTPS (80/443), SMTP/IMAP/POP ports (if you host mail), and cPanel/WHM ports match your policy.
If you want a WHM-safe baseline, pair this move with this CSF + LFD setup guide.
Step 2: Lower DNS TTL ahead of the cutover
Lowering TTL doesn’t move traffic. It only makes the eventual change propagate faster.
Do it 4–24 hours before cutover so caches pick up the lower value.
- If DNS is hosted at the registrar or a DNS provider: lower TTL on the A, AAAA, and MX records you’ll change.
- If DNS is hosted on the source cPanel server: lower TTL in the zone editor (WHM or cPanel) and ensure zones actually serve from that machine.
For a step-by-step plan for the DNS moment itself, keep this DNS cutover checklist open during the final switch.
Step 3: Choose a migration method (WHM Transfer Tool vs full backups)
For cPanel-to-cPanel moves, choose the simplest method that preserves account ownership, permissions, and metadata.
Option A (recommended): WHM Transfer Tool
- Pros: automates account copy, restores, and handles multiple accounts.
- Cons: requires network access between servers; large accounts can take time.
On destination WHM: Transfers → Transfer Tool and enter the source server IP and root credentials or an access hash.
Select accounts and start the transfer.
Option B: Create full account backups and restore
- Pros: easy to stage and repeat; works even if you can’t open transfer ports.
- Cons: manual; you must keep track of what changed after the backup.
On source WHM: Backup → Backup Configuration (ensure backups are enabled). Then use Backup → Backup Restoration on destination or use the restore tools.
Step 4: Freeze content changes (or plan for a final sync)
If the site changes all day (WooCommerce orders, form leads, membership updates), one copy won’t be enough.
Use one of these approaches:
- Maintenance window: put the site into a short maintenance mode during final sync and cutover.
- Two-pass copy: migrate once, test on destination, then do a final sync near cutover time.
For WordPress stores, treat the final window like a checklist item, not a guess. HostMyCode has a practical walkthrough here: WordPress maintenance mode tutorial (2026).
Step 5: Migrate the account(s) and verify ownership, PHP, cron, and DNS zones
After transfer/restore finishes, pause. Don’t cut DNS yet.
Verify the account from the inside out.
1) Confirm the account exists and paths look correct
- WHM → List Accounts: verify domain, user, and assigned IP.
- SSH: check home directory and permissions.
ls -lah /home
ls -lah /home/USERNAME/public_html
2) Verify PHP version and handler (MultiPHP + PHP-FPM where needed)
Sites often fail on the new server because the default PHP version is different.
In WHM, confirm:
- MultiPHP Manager: domain → PHP version
- MultiPHP INI Editor: memory_limit, upload_max_filesize as needed
If you want PHP-FPM for steadier performance under load, enable it after the site renders correctly.
Migration day is not the time to add extra variables.
3) Check cron jobs
In cPanel for the account: Cron Jobs. Confirm schedules and paths.
WordPress scheduled tasks are a common post-move casualty. If they stop firing, use this WP-Cron troubleshooting tutorial after cutover.
4) Confirm DNS zones were migrated (if you host DNS in WHM)
WHM → DNS Functions → Edit DNS Zone. Make sure records match what the domain actually uses.
Pay close attention to:
- A/AAAA for root and www
- MX records and their priorities
- TXT records (SPF, DKIM, DMARC, site verification)
Step 6: Test the site on the new server before switching DNS
You need a realistic test. It should hit the destination server while public DNS still points at the source.
Method A: Use your local hosts file
Map the domain to the destination IP on your own machine. Example (macOS/Linux):
sudo nano /etc/hosts
Add:
203.0.113.10 example.com www.example.com
Test in a private/incognito window. Nothing changes for the rest of the world.
Method B: Use a temporary subdomain
Create staging.example.com pointing to the destination IP and preview the site there.
This works well if the app doesn’t hardcode the main domain. WordPress often does.
For WordPress, hosts-file testing is usually cleaner.
What to verify (fast checklist)
- Home page loads with correct CSS/JS (no mixed content warnings)
- Admin login works (WordPress /wp-admin or app backend)
- Contact forms submit (watch mail logs if local delivery)
- Checkout flow if eCommerce (in test mode if possible)
- Uploads and media display (permissions and PHP limits)
- Redirects are correct (HTTP→HTTPS, www↔non-www)
Step 7: Handle SSL correctly (AutoSSL, redirects, and HSTS)
On cPanel, the goal is simple. Have valid certificates before cutover, then keep redirects consistent.
- WHM → Manage AutoSSL: confirm provider and status.
- WHM → SSL/TLS Status: run AutoSSL for the migrated domains.
If AutoSSL fails, don’t do random “try this” fixes. Work through DCV and DNS causes with this AutoSSL troubleshooting tutorial.
It covers the common migration patterns (wrong vhost, wrong DNS, pending DCV).
HSTS warning: if the domain uses HSTS with a long max-age, browsers will refuse HTTP and demand valid HTTPS.
That’s fine if the destination SSL is correct. It’s painful if it isn’t.
Step 8: Migrate email without losing messages (MX strategy)
Email is where clean migrations get messy.
Treat web and mail as separate cutovers unless you’re confident the destination mail stack is ready.
Decide your mail scenario
- Mail hosted externally (Google Workspace/Microsoft 365): keep MX unchanged; only migrate the website.
- Mail hosted on the cPanel server: you must migrate mailboxes and coordinate MX and SPF changes.
For cPanel-hosted mail, do this before cutover
- Verify mailboxes exist and quota is correct on destination.
- Confirm Exim/Dovecot services are running.
- Confirm DKIM is enabled and DNS has the right TXT record after the move.
Plan reverse DNS for the new server IP as well. Many receivers score mail aggressively when PTR/rDNS doesn’t match the sending host.
Use this PTR record setup tutorial to set rDNS correctly, then verify HELO/hostname alignment.
Cutover tip: keep old mail server accepting mail for a short overlap
Even with a low TTL, some senders keep cached MX records.
If you can, keep the source server up for 24–48 hours. That overlap prevents quiet message loss.
Step 9: DNS cutover (A/AAAA, MX, and nameservers) with verification commands
Once the destination site and SSL look right, switch traffic. Use one of these patterns:
- Change A/AAAA records at your DNS provider to the destination IP (most common).
- Change nameservers to your new nameservers (only if you truly want the new server to host DNS).
Verify propagation the right way
Don’t rely on one “DNS checker” website. Query authoritative sources and a couple of public resolvers:
dig A example.com +short
dig A example.com @1.1.1.1 +short
dig A example.com @8.8.8.8 +short
dig MX example.com +short
If you see wrong-IP, NXDOMAIN, or split-brain behavior, follow this DNS propagation troubleshooting tutorial. It’s written for hosting moves, not generic DNS theory.
Step 10: Post-cutover checks (first 60 minutes)
Right after cutover, look for issues that only show up with real traffic and real browsers.
Web checks
- Test from a device not using your hosts-file override.
- Confirm HTTPS certificate is the expected one (issuer, SANs, expiry).
- Spot-check 5–10 important URLs and the admin area.
Server-side quick diagnostics
# Watch web server errors (paths vary by stack)
tail -n 200 /usr/local/apache/logs/error_log
# If using Nginx in front (common in some cPanel setups)
tail -n 200 /var/log/nginx/error.log
# Check mail logs (Exim)
tail -n 200 /var/log/exim_mainlog
If disk usage jumps after the move, logs are often the culprit.
Set retention early with this logrotate tutorial so one noisy vhost doesn’t fill your VPS.
Step 11: Rollback plan (so you’re not improvising under pressure)
If you keep the source server intact, rollback is usually “point DNS back.”
People miss what comes next.
Rollback checklist
- Switch A/AAAA back to the source IP (or revert nameservers).
- If you switched MX, revert MX too.
- Disable any forced redirects you added during cutover testing.
- Document what changed on destination so you can re-attempt cleanly.
Keep the source server running until you’re confident. Typically that’s 48–72 hours for small sites, and longer for busy mail domains.
Step 12: Clean up after a successful migration
Once traffic is stable and mail flow is normal, finish the housekeeping.
- Raise TTL back to normal (e.g., 3600–14400 seconds) to reduce query noise.
- Review SPF and ensure it includes the new sending IP if you send mail from the server.
- Enable automatic updates/patching policies appropriate for your environment.
- Confirm backups on the destination and perform a test restore.
If you want a restore drill that won’t break live sites, keep a tested runbook. Use this cPanel backup restore tutorial as a reference.
Summary: a clean migration is mostly planning
Good migrations are uneventful. Lower TTL early. Copy accounts with WHM tools. Test the destination via hosts-file overrides.
Then confirm SSL and mail readiness, and cut DNS with real verification commands.
The safety trick is keeping the source server available until you trust the new VPS.
If you’re moving production sites and want predictable performance after landing, size your VPS for bursts and background jobs. CPU and NVMe storage matter here.
Start with a HostMyCode VPS, or hand the operational work to managed VPS hosting so cutover day stays controlled.
If you’re planning a cPanel migration and want fewer moving pieces, HostMyCode can host your destination on a HostMyCode VPS sized to handle transfer spikes and post-cutover traffic. If you prefer a guided move, HostMyCode migrations can help with DNS, SSL, and email, including a rollback plan you can actually use.
FAQ
How long should I keep the old server after the DNS cutover?
For most sites, keep it for at least 48 hours. For domains that host email on the server, 72 hours is safer because MX caching and delayed delivery are common.
Should I switch nameservers or just update A records?
Update A/AAAA records if you’re happy with your current DNS provider. Switch nameservers only if you intend to move DNS hosting (and you’ve validated zones, glue records, and propagation behavior).
What’s the best way to test the new server without changing public DNS?
Edit your local hosts file to map the domain to the destination IP. It’s quick, reversible, and doesn’t affect anyone else.
Why does email break after migrating to a new VPS?
Most often it’s rDNS/PTR mismatch, missing SPF updates, or DKIM/DMARC misalignment. Another common issue is changing MX too early while clients still connect to the old server.
Can I migrate a live WooCommerce store without losing orders?
Yes, but plan a short maintenance window for final sync, or keep writes minimal during cutover. Always test checkout end-to-end on the destination before switching DNS.