Moving to a new server: plan your migration

A practical plan for moving from one server or plan to another, covering inventory, backups, copying data, testing, switching DNS and cancelling the old service only when you are sure.

  • Beginner
  • All
  • 5 min read

By RunRacks Team · Published

Moving to a new server is mostly planning. The copying itself is often the quickest part. What causes trouble is the forgotten cron job, the firewall rule nobody wrote down, or a DNS change made before the new server was ready. This guide gives you a plan that works whether you are moving to a bigger RunRacks plan, a different location, or from another provider.

Before you start

  • Access to the old server (SSH or Remote Desktop) and to wherever your domain's DNS is managed.
  • A new server, ordered from Pricing and showing in your Dashboard. Keep the old one running until the very end.
  • A rough idea of how much data you need to move. On Linux, du -sh /var/www /home gives a quick size for common folders.

Step 1: take inventory

Write down everything the old server does. A plain text list is enough. Go through:

  • Apps and services: web server, database, PHP or Node.js versions, background workers, Windows services, trading terminals.
  • Data: website files, databases, uploads, user home folders, app data folders on Windows.
  • Scheduled tasks: cron jobs on Linux (crontab -l for each user, and files in /etc/cron.d), or Task Scheduler on Windows.
  • Network settings: open ports, firewall rules, allow-lists that include the server's IP.
  • Certificates and secrets: SSL certificates, API keys, .env files, licence keys.
  • DNS records: every record that points at the old IP address, including subdomains and mail.

Step 2: back up the old server

Take a full backup before you touch anything. Store it off the server: on your own computer or in separate storage. If something goes wrong during the move, this is your way back.

For databases, take a proper dump rather than copying live data files. A copy of the files of a running database can be inconsistent.

Step 3: lower the DNS TTL early

DNS records have a TTL (time to live) that tells resolvers how long to cache them. If your records use a long TTL, lower it to something like 300 seconds (five minutes) a day or two before the move. Then, on switch-over day, the change reaches users quickly.

You change the TTL where your domain's DNS is hosted. RunRacks does not sell domains, so that is usually your domain registrar or DNS provider.

Step 4: set up the new server

  1. Log in with the details from the new service page in the Dashboard.
  2. Change the password and install updates.
  3. Install the same software you listed in Step 1, at the same or a compatible version.
  4. Recreate users, firewall rules and scheduled tasks.

On Windows, remember that Remote Desktop on RunRacks servers uses port 12230. Connect with 198.51.100.20:12230, and keep that port open in Windows Firewall.

Step 5: copy your data

On Linux, rsync over SSH is the usual tool. Run it from the new server to pull files from the old one:

Terminal
rsync -avz --progress [email protected]:/var/www/ /var/www/

Here -a keeps permissions and timestamps, -v shows each file and -z compresses data on the way. The trailing slashes matter: they copy the contents of the folder.

Import database dumps on the new server, then check the row counts or a few records.

On Windows, copy files through the Remote Desktop clipboard for small amounts, or use a file transfer tool for larger ones.

Step 6: test before you switch

Test the new server while users still go to the old one.

  • Websites: edit the hosts file on your own computer so your domain points at the new IP for you only. On Windows it is C:\Windows\System32\drivers\etc\hosts; on macOS and Linux it is /etc/hosts. Add a line such as:
Text
  198.51.100.20 example.com www.example.com

Browse the site, log in, submit a form, and check images and SSL. Remove the line afterwards.

  • Apps and bots: run them on the new server against test settings first.
  • Scheduled tasks: confirm they run at least once.

Step 7: switch over

  1. Pick a quiet time.
  2. If data changes often (databases, uploads), stop writes on the old server and do a final rsync and database dump.
  3. Update your DNS A records (and AAAA if you use IPv6) to the new IP address.
  4. Update allow-lists, broker whitelists and any app that connects by IP.

Watch the new server's logs as traffic arrives.

Step 8: cancel the old service last

Leave the old server running for a few days while you watch for problems. When you are confident nothing still points at it, take one last backup and submit a cancellation request for the old service. Read /terms and /refund first so you know how cancellations are handled.

Check it works

  • dig +short example.com (or nslookup example.com on Windows) returns the new IP.
  • The old server's access logs show no new visitors after a day or two.
  • Every item on your inventory list is ticked off on the new server.

Troubleshooting

  • Some visitors still reach the old server: their resolver cached the old record. Wait until the old TTL has passed.
  • The site loads but shows errors: a PHP extension, file permission or config value is missing. Compare with your inventory list.
  • Emails stopped working: an MX, SPF or other mail record still points at the old IP.
  • A scheduled task did not run: it was not recreated, or its time zone differs on the new server.

Next steps

Was this guide helpful?

Still stuck?

Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Getting started

Edit files with nano: a beginner's guide

Open, edit, search and save files with the nano text editor on a Linux server, including cutting and pasting lines, showing line numbers and safely editing system config files with sudo.

  • Beginner
  • Linux VPS
  • 5 min read

Getting started

Your first hour with a new RunRacks server

A step-by-step roadmap for the first hour after your RunRacks server is delivered, from finding your login details to changing the password, updating the OS and picking your next guides.

  • Beginner
  • All
  • 5 min read

Getting started

How to choose a server location

Pick a data center location based on where your users, broker or team are, confirm it with ping tests, and weigh the legal and latency points that come with each choice.

  • Beginner
  • All
  • 4 min read