Most failed migrations do not fail during the move. They fail three weeks later when a cron job that never ran on the old host turns out to have been the only thing pruning a log directory, or when the mail server stops relaying because the new provider blocks port 25 and nobody checked. This checklist is the pre-flight pass: what to inventory on the source, what to prove on the target before the switch, and the post-cutover checks that catch what the pre-flight missed.
Step 1: Capture the Source Machine’s Real State
Before copying anything, record the numbers the new plan has to beat. A cheap destination plan is often smaller in one dimension than the source, and you want to discover that now rather than after DNS has moved.
# disk and inode headroom — both matter, inodes often bite first
df -h; echo; df -i
# top directories by size, skipping mounts
du -xhd1 / 2>/dev/null | sort -h | tail -15
# memory and swap in use at peak
free -m; swapon --show
# kernel, distro and PHP/MySQL versions
uname -r; cat /etc/os-release | head -3
php -v | head -1; mysql --version; nginx -v 2>&1
# listening services and firewall
ss -tulpn
iptables-save > /root/iptables.bak 2>/dev/null; nft list ruleset > /root/nft.bak 2>/dev/null
Note the df -i figure against the destination’s. A source with 4 million inodes in use will not fit on a plan capped at 500,000, even if the byte count looks fine. Also record the PHP minor version: an app that works on 8.1 may throw deprecation warnings on 8.3, and a cheap new plan will often ship 8.3 as default.
Step 2: Inventory Every Scheduled Job
Cron is the most common silent breakage. Collect every scheduler in one place and read each line.
for u in $(cut -d: -f1 /etc/passwd); do echo "== $u"; crontab -l -u "$u" 2>/dev/null; done
ls -1 /etc/cron.d/ /etc/cron.daily/ 2>/dev/null
systemctl list-timers --all --no-pager
# anything referencing a path that will change
grep -rE "rsync|backup|/srv/|/home/" /etc/cron* 2>/dev/null
| Job | Breakage risk on new host | Check |
|---|---|---|
| Certbot renew | Timer missing or wrong challenge type | certbot renew --dry-run |
| Backup to object storage | Credentials/env file not copied | Run once manually, check exit code |
| Database optimise | Version-specific SQL syntax | Run on target, read stderr |
| Log rotation | Custom logrotate config under /etc/logrotate.d | logrotate -d on target |
| App queue worker (systemd) | Unit file not enabled | systemctl is-enabled |
Step 3: Lower DNS TTLs on a Schedule
TTL reduction must happen at least two times the current TTL before cutover, because resolvers cache the old value until it expires. Record the current TTLs, then set A, AAAA, MX and relevant CNAMEs to 300 seconds.
# current TTLs and resolved values
dig +noall +answer example.com A
dig +noall +answer example.com MX
dig +noall +answer www.example.com CNAME
# typical schedule for a 3600s TTL:
# T-2h or earlier: set TTL to 300, wait for old TTL to expire
# T-26h: verify propagation with a public resolver
dig @1.1.1.1 example.com A +noall +answer
If your DNS is hosted at the provider you are leaving, move the zone to a third-party nameserver days before cutover and change the registrar’s NS records first. Migrating DNS and the web server in the same hour doubles your rollback time.
Step 4: Prove TLS Issuance on the Target
Do not assume the new host can obtain certificates. Some cheap plans sit behind NAT without port 80 reachable, which breaks HTTP-01 challenges. Before cutover, confirm inbound 80/443 reach the destination.
# from the target, confirm a webserver answers on 80 from outside
curl -I http://target-ip/ -H "Host: example.com"
# then a test issuance for the real name — this must succeed pre-cutover
certbot certonly --webroot -w /var/www/html -d example.com --dry-run
# if DNS-01 with a provider API is available, staging test:
certbot certonly --dns-cloudflare -d example.com --staging
Rate limits are the real cost of getting this wrong: five duplicate certificate limits per week per domain set means a botched cutover can leave you unable to issue for days. Always run --dry-run or --staging first. If you are copying the existing certificate instead of reissuing, copy /etc/letsencrypt whole, account key included, or renewals on the new host will fail.
Step 5: Mail Records Are Not Optional
Even if the site does not send mail, the domain probably does — password resets, contact forms, transactional receipts. Port 25 is blocked on a majority of budget providers, and many also block 465/587 until you request unblocking.
| Record | What to capture | Failure symptom |
|---|---|---|
| MX | Priorities and target hostnames | Inbound mail bounces after cutover |
| SPF (TXT) | Full string, including includes | Outbound mail marked spam |
| DKIM | Selector name + public key; private key on the host | DMARC fails, delivery drops |
| DMARC | Policy and rua address | Reports lost, policy silently stricter |
| PTR / rDNS | Requested from the new provider | Major mailbox providers reject or greylist |
dig +short example.com MX
dig +short example.com TXT
dig +short SELECTOR._domainkey.example.com TXT
# outbound test from the target before cutover
echo test | mail -s test [email protected] && tail -5 /var/log/mail.log
If the new provider blocks port 25 permanently, the correct answer is to relay outbound mail through a transactional provider and add its include to SPF — not to keep the old host alive purely for mail.
Step 6: Restore Test on the Target, Not Just a Copy
The migration is only as good as a restore you have actually performed. On the target, before DNS changes, do a full restore and then compare it against the source numerically.
# row counts on the three biggest tables, both hosts
mysql -N -e "SELECT table_name, table_rows FROM information_schema.tables
WHERE table_schema='appdb' ORDER BY table_rows DESC LIMIT 3;"
# file counts and total size
find /var/www/html -type f | wc -l; du -sh /var/www/html
# checksums of a sample of static assets
find /var/www/html/uploads -type f -name '*.jpg' | head -50 | xargs md5sum | sort -k2 | md5sum
Then serve the restored site locally against the real domain name using a hosts-file override, and click through the five pages that matter most: home, a deep article, a search result, a form submission and a login. This catches hardcoded absolute URLs, missing rewrite rules and plugin licence issues that a checksum comparison will not.
Pre-Flight Checklist Summary
- Disk and inode usage measured on source; destination limits confirmed.
- PHP and MySQL versions on target matched or tested against the app.
- Every cron job, systemd timer and logrotate config inventoried.
- TTL lowered 2× current value ahead of cutover; DNS zone on an independent provider.
- Firewall rules exported and recreated on the target.
- TLS dry-run successful; account key copied if using the existing cert.
- MX, SPF, DKIM, DMARC captured; outbound mail tested from the target.
- Full restore performed and verified numerically and by clicking through.
- Rollback plan written: old IP, old instance still paid, and a time to revert by.
Post-Cutover Verification
After the switch, verify from outside rather than from the server itself — the server always thinks it works. Run these within the first hour.
# confirm the world sees the new IP
dig @8.8.8.8 example.com +short
# TLS chain validity and expiry
curl -sSI https://example.com | head -5
openssl s_client -connect example.com:443 -servername example.com /dev/null | openssl x509 -noout -dates -issuer
# status codes for key paths
for p in / /robots.txt /sitemap.xml /wp-login.php; do echo -n "$p "; curl -so /dev/null -w '%{http_code}\n' https://example.com$p; done
# mail path
dig +short example.com MX
Then check the things that only fail under use: submit the contact form, trigger a password reset, and confirm a search returns results from the new database rather than a cached page. Watch journalctl -f and the nginx error log for the first 24 hours; most cutover faults appear as a slow trickle of 404s on paths that existed with a different permalink structure on the old host.
The First Week After Cutover
Keep the old instance paid and powered for seven days — the cost of a week’s overlap on a cheap plan is less than an hour of downtime, and it is your only fast rollback. During that week, check three things daily: that backups run on the new host and land off-host, that certificate renewal succeeded (or is scheduled correctly), and that the destination’s disk usage is not climbing faster than the plan can absorb. If any of those look wrong, reverting the A record is a five-minute operation while you still have the source intact.
For sizing the destination plan before you start, the price-banded tables at the VPS provider comparison are ordered to match this checklist’s disk and memory figures.
