Skip to content

Cleaning up the old cPanel server after a migration

The source server should stay alive in read-only mode for a week, then be retired methodically. Skipping the cleanup costs both money and security.

After a successful cPanel migration, the source server is no longer serving production traffic — but it still exists, still costs money, still has root access for everyone who had it before, and still has a copy of the customer’s data. The cleanup is not just “shut it down”. It is a planned decommission that preserves the rollback option for a week, then methodically removes data, revokes access, and finally retires the box.

What’s happening

A migration only succeeds in retrospect. The destination might look healthy for three days and then surface a problem that requires going back to the source — a stale config file, a script the destination’s PHP version cannot run, a forgotten domain that was never copied. Keeping the source online but isolated for a week buys that insurance. Past a week, the destination is the canonical truth and the source becomes a liability: a copy of customer data that nobody is patching, monitoring, or paying attention to.

How to verify

Check the source’s state one week post-cutover:

# is anything still hitting the source?
ss -tn state established | head
tail -100 /usr/local/apache/domlogs/<domain> | tail -20
# is mail still queued or arriving?
exim -bpc
tail -50 /var/log/exim_mainlog | grep -v "Completed"
# is the destination handling everything?
ssh root@<destination> "exim -bpc ; df -h /home"
# what was the source's data we want to preserve?
ls -lh /backup/cpanel/<date>/accounts/<user>.tar.gz

The fix

The cleanup, day by day:

  1. T+1 day — confirm destination is healthy. Make the source’s httpd refuse new connections (or set firewall rule to drop port 80/443 from the world). Keep WHM accessible from your office for emergency rollback.
  2. T+2 to T+7 — read-only watch. The source is alive but not serving. If a rollback is needed, undo this in 5 minutes. Watch the source’s logs daily for any traffic that bypassed DNS and hit the IP directly.
  3. T+7 days — final backup. Snapshot the source one more time to your long-term backup store. This is your “in case of catastrophe” copy.
  4. T+8 days — revoke access. Remove all SSH keys from /root/.ssh/authorized_keys except yours. Disable WHM logins for everyone but root. Document who was removed.
  5. T+9 days — data wipe. dd if=/dev/zero of=/home/scratch bs=1M count=10000 followed by rm to overwrite free space (or use the provider’s secure-wipe option). For very sensitive data, the host should be reprovisioned.
  6. T+10 days — shutdown and cancellation. Cancel the license, cancel the host, archive the final backup somewhere durable for compliance retention.

Skipping the wipe step is how customer data ends up in a hosting provider’s recycled disk. Stack Harbor handles decommission cleanup as part of migration solutions — start a conversation when retiring the source.