Deleting is quick and there is no undo. The order below takes ten minutes and keeps everything that turns out to matter later - and something always does.
Take a copy first, of more than the files
- Files and database, obviously.
- Mail. Deleting hosting deletes the mailboxes, and the messages with them.
- The DNS zone. Export it. Rebuilding thirty records from memory is a bad afternoon.
- The certificate and any keys, if anything else depends on them.
Then check what points at it
A site being removed is often referenced by something that is staying: a form that posts to it, an image hot-linked from another site, a cron job on a different server, an API a mobile app still calls. Search for the domain before it stops answering.
grep -rn "old-site.com" /var/www/ --include="*.php" | head -20
Leave a redirect, not a hole
If the content moved, redirect it. A 301 keeps the standing the old address earned and takes visitors to the right place; deleting it drops both.
server {
server_name old-site.com;
return 301 https://new-site.com;
}
And if it is genuinely gone
Return 410 rather than 404. It says "this existed and is deliberately gone", and search engines drop it faster and more cleanly than a 404 that might just be a mistake.
The order
- Copy everything, including mail and DNS —
- Verify the copy opens — Not that it exists - that it opens.
- Put the redirect or the 410 in place —
- Wait a fortnight — Watch the log for anything still asking.
- Then delete —
Do not cancel the domain at the same time. Keeping the name for another year costs little and keeps the redirect working, which is the part visitors actually meet.