All articles

How to Migrate Your VPS to a New Host

By Harborvm7 min read

How to Migrate Your VPS to a New Host

Key takeaways

  • Migrate your VPS to a new host in a fixed order: audit, build the new server, back up, transfer, test on the IP, lower DNS TTL, switch, then decommission.
  • Lower your DNS TTL a day or two before cutover so the change propagates in minutes instead of days. RFC 1912 notes that 1-5 day TTL values are typical for stable records.
  • Use rsync over SSH to copy files incrementally, so the final sync only moves what changed since the first pass.
  • Test the new server on its raw IP and through a hosts-file override before you touch DNS. Never point traffic at an untested box.
  • Keep the old VPS running, paid, and untouched for a few days after cutover. It is your only rollback if something was missed.

To migrate your VPS to a new host with minimal downtime, you prepare the new server fully before you touch anything live: build it, copy your data, test it on its own IP address, and only then switch DNS. The order matters more than the speed. Rush the cutover and you drop traffic; follow the sequence below and most sites move with a gap measured in minutes.

This guide walks through a Linux VPS migration end to end. The same pattern works whether you are leaving one provider for another or consolidating several small servers into one larger box.

How Do You Plan to Migrate a VPS to a New Host With Minimal Downtime?

Good planning turns a migration into a copy job instead of a gamble. Start by writing down everything the current server runs: the web server, databases, cron jobs, firewall rules, SSL certificates, mail relays, and any custom services. If you cannot list it, you cannot move it.

Downtime comes almost entirely from two things: the final data sync and DNS propagation. You control both. You shrink the sync by copying most of the data in advance, then syncing only the delta at cutover. You shrink the DNS wait by lowering your record's time-to-live ahead of the move.

Set a maintenance window when traffic is lowest. Tell anyone who depends on the server. Then build the new VPS and bring it to the point where it can serve your application, just without live traffic pointed at it yet. On Harborvm a fresh Ubuntu, Debian, AlmaLinux, Rocky Linux, or Fedora VPS is ready in about a minute, so the new box can sit waiting while you work.

One honest limit to plan around: Harborvm offers no backups and no snapshots, so you keep your own copies. That is normal for a migration anyway. You are making copies as part of the process, and those copies are your safety net if the move goes wrong.

How Do You Back Up Files, Databases, and Configs?

Back up in three separate buckets, because each restores differently: application files, databases, and system configuration. Treating them as one blob is how people lose data at 2 a.m.

For files, archive the directories your app actually uses. A web app usually lives under /var/www and /etc:

tar -czf site-files.tar.gz /var/www /etc/nginx /etc/letsencrypt

Databases need a consistent dump, not a raw file copy. A live database file copied mid-write is often corrupt. Use the proper tool:

# MySQL / MariaDB
mysqldump --single-transaction --all-databases > db-dump.sql

# PostgreSQL
pg_dumpall > db-dump.sql

Configuration is the part people forget. Record your firewall rules, cron entries (crontab -l), environment variables, and the list of installed packages. On Debian or Ubuntu, dpkg --get-selections gives you a reusable package list; on AlmaLinux, Rocky, or Fedora, use dnf history or rpm -qa.

Write down your TLS setup too. If you use Let's Encrypt, the certificate itself is easy to reissue on the new host. HTTPS is effectively the default now: Let's Encrypt reported it was "frequently issuing ten million certificates per day" as of late 2025 (Let's Encrypt, "10 Years of Let's Encrypt Certificates," retrieved 2026-10-27). So rather than copying private keys around, plan to request fresh certificates on the new server once DNS points at it.

How Do You Transfer Data Securely to the New Server?

Transfer over SSH, and use rsync so you only copy what changed. rsync is the standard tool for incremental file sync on Linux, which is exactly what a staged migration needs: a slow first pass, then a fast second pass at cutover.

Run the copy from the new server, pulling from the old one. First the archives you made:

rsync -avz -e ssh user@old-server-ip:/root/site-files.tar.gz /root/
rsync -avz -e ssh user@old-server-ip:/root/db-dump.sql /root/

For large or frequently changing data, rsync the live directory directly. The first run copies everything; a second run hours or days later copies only the difference:

rsync -avz --delete -e ssh user@old-server-ip:/var/www/ /var/www/

Use SSH keys, not passwords, for these transfers, and for all admin access afterward. If you have not set keys up on the new box yet, do that first. A private network helps here too: Harborvm gives each customer a private network with a built-in WireGuard VPN, so server-to-server traffic can stay off the public internet entirely.

Now restore into the new server. Unpack the files and import the database:

tar -xzf site-files.tar.gz -C /
mysql < db-dump.sql        # or: psql -f db-dump.sql

Reinstall your services, apply your saved config, and bring the application up bound to the new server's address.

Close-up of colorful Ethernet cables connected to network switch ports in a server room.

How Do You Update DNS and Test Before Cutover?

Test first, switch DNS second. Never point real traffic at a server you have not proven works.

Before touching DNS, lower the TTL on the records you will change. TTL tells resolvers how long to cache your current IP. If it is set to a day, visitors can keep hitting the old server for a day after you move. RFC 1912 notes that "1-5 days are typical" TTL values for stable records (RFC 1912, IETF, retrieved 2026-10-27). Drop yours to 300 seconds a day or two ahead, so the eventual switch propagates in minutes.

Test the new server on its raw IP first. Load the site by IP, or override your own machine's resolution with a hosts-file entry:

# /etc/hosts  (your laptop, not the server)
203.0.113.10   example.com www.example.com

With that line, your browser hits the new server while the rest of the world still uses the old one. Click through the real site: log in, submit a form, check the database writes land. Fix anything broken now, while nobody else is affected.

When it all works, update the DNS A (and AAAA) records to the new IP. Because you lowered the TTL, most resolvers pick up the change quickly. On Harborvm each VPS sits behind the server's public IP with forwarded ports rather than a dedicated public IPv4, so point your records at the server's IP and forward the ports your app uses (up to 10). Harborvm also issues automatic HTTPS on your own domain, so certificates reissue without manual key copying.

How Do You Decommission the Old VPS Safely?

Do not cancel the old server the moment DNS flips. Keep it running, paid, and untouched for several days. Until every resolver and every cached client has moved to the new IP, the old box may still be serving real users.

Watch the new server's traffic. Harborvm shows live CPU, memory, disk, and network graphs, so you can see requests arrive on the new VPS and taper off on the old one. Only when the old server goes quiet should you plan its shutdown.

Before you wipe it, take one last full copy of everything and store it off the server. Remember that no host restores your data for you, so this archive is your final record. Pull it down to your own machine or to the new VPS.

Then decommission in order:

  1. Stop the services on the old server.
  2. Confirm the new server handles all traffic with no errors for a full day.
  3. Download or verify your final backup off the box.
  4. Securely wipe sensitive data and cancel the plan.

On Harborvm you can cancel any time and the VPS runs to the end of the paid period, so there is no rush to delete on the exact cutover day. Let the paid time act as a buffer.

Your Next Step

Pick your maintenance window and build the new server today, well before you plan to move. An idle VPS waiting with your data already copied costs little and removes nearly all the pressure from cutover day. When you are ready to spin up the target, deploy a Linux VPS from your browser in about a minute and start the first rsync pass while you finish your checklist.

Frequently asked questions

How do I migrate a VPS with minimal downtime?

Build and test the new server first, do an initial data sync, then lower your DNS TTL a day ahead. At cutover, stop writes, run a final rsync, point DNS at the new IP, and keep the old server until traffic has fully moved.

How long does DNS propagation take when I switch hosts?

It depends on your record's TTL. If the TTL is 3600 seconds, resolvers may cache the old IP for up to an hour. Lower the TTL to 300 seconds a day or two before the move so the switch takes effect in minutes.

Should I delete the old VPS right after migrating?

No. Keep it running and paid for a few days after cutover so you can roll back if something was missed. Only wipe and cancel it once you have confirmed the new server handles all traffic correctly.

Can I move a Windows VPS the same way?

The DNS and testing steps are identical, but Windows data moves with its own tools (file copy, Robocopy, or application-level export) rather than rsync. On Harborvm you reinstall Windows from your own ISO and licence, then restore your data onto the new VM.