Migration

Moving to a new server: the small things that bite

In this article5 sections

Copying the website and the database to a new server is the easy part of a migration. The surprises come from everything around them: the things that quietly depended on the old machine. Here is the list we check, because each one has caused a bad evening for someone.

Other people know your old address

  • IP allowlists at third parties. Registrar APIs, payment gateways, SMTP relays and partner firewalls often accept requests only from a fixed address. After the move they see a stranger and refuse. Make a list before the switch and ask each one to allow the new address, because some take a day.
  • Your own firewall and database rules that mention the old address, and any monitoring that watches it.
  • Reverse DNS and mail. If the server sends email, the new address needs a sensible reverse DNS name, and SPF must list it. Otherwise mail goes to spam.

Things that ran on a schedule

  • Cron jobs and timers. List them on the old server (crontab -l for each user, /etc/cron.d, systemctl list-timers) and recreate them. Make sure the same job does not run on both servers at once during the overlap.
  • Backups. The new server needs its own backup job, and a restore test, before the old one is retired.
  • Time zone. A job at 03:00 means something different if the new machine is in another zone.

Things that look the same but are not

  • Software versions. A newer PHP, a different database default or a missing extension can break an application that worked yesterday. Match versions first, upgrade on purpose later.
  • File ownership and permissions. Copying as the wrong user leaves files unreadable by the web server. Check that uploads are writable and that nothing is world-writable by accident.
  • Cached code. After deploying on a PHP server, reload the PHP service so it stops serving the old code from memory.
  • Secrets and environment files. Keys, tokens and .env files are not in the repository, so they do not arrive by themselves.

DNS, certificates and caches

  • Lower the TTL a day ahead so the change spreads in minutes, then raise it again afterwards.
  • Certificates. Check that automatic renewal works on the new server before you rely on it. Run the renewal in dry-run mode.
  • CDN and browser caches. Old files can linger. Use versioned file names or purge the CDN after the switch.

Keep a way back

Leave the old server untouched and running until the new one has served real traffic for several days. If something is wrong, going back should be a single DNS change.

Our migration plan walks through the full sequence, and the server migration service covers all of this, with a rollback ready at every step.