How to Migrate Between VPS Providers with Zero Downtime

To migrate VPS providers without downtime, you need a plan that treats the old server as live until the new one proves itself. The move itself is rarely the hard part. The hard part is the order of operations: what you copy first, when you freeze writes, and how you confirm the new server works before visitors ever reach it.

Most failed migrations share the same pattern. Someone cancels the old server too early, changes DNS before testing, or discovers after the switch that uploads, cron jobs, or email routing were never copied. A careful sequence avoids all three problems, and it costs little extra time.

This guide walks through that sequence. It assumes a typical Linux VPS running a website with a database, and it works whether you are moving to a cheaper plan, a faster region, or a provider with better support. If you are still choosing an unmanaged VPS, settle that choice first, because every step below depends on the new server’s operating system, PHP or runtime version, and database version matching your needs.

How to Migrate VPS Providers in Seven Steps

The short version is: prepare, copy, test, sync again, switch, watch, then clean up. Each step below expands on one part of that chain. Do not skip the testing step. It is the step that turns a risky move into a boring one.

Step 1: Audit the Old Server Before You Copy Anything

Start by listing everything the old server actually does. Websites are the obvious item, but servers collect side jobs over time. Check for cron jobs, scheduled backups, email forwarding, queue workers, and any service that runs in the background. Run a process list, read the crontab for every user, and note which ports are listening.

Next, record versions: operating system, web server, database, PHP or application runtime, and any extensions your app needs. A move from PHP 8.1 to 8.3, for example, can break old plugins or libraries. Matching versions on the new server removes a whole class of surprises. Note SSL certificate details too, including whether certificates renew automatically and which domains they cover.

Finally, measure the size of what you must move. Check disk usage for web files, databases, uploads, and logs. Logs usually do not need to move, and leaving them behind saves transfer time. This audit becomes your checklist later, when you verify that nothing was left behind.

Step 2: Lower DNS TTLs Early

DNS records carry a time-to-live (TTL) value that tells resolvers how long to cache them. If your TTL is 24 hours, a DNS change can take a full day to reach every visitor. Lower the TTL to 300 seconds (five minutes) at least 48 hours before the switch, so the old value expires everywhere before moving day.

This step costs nothing and it is the single most effective way to make a migration feel instant. Do it early, because lowering the TTL only helps after the old, longer TTL has expired. If you lower it the same day you switch, many resolvers will still hold the old record. For background on picking a provider with good DNS controls, see this comparison of DNS providers and their features.

Step 3: Set Up and Harden the New Server

Install the same operating system and stack versions you recorded in step 1. Create the same user accounts, set up the firewall, and install the web server, database, and runtime. Configure SSL, even if you plan to test with a temporary hostname first. A certificate from Let’s Encrypt works fine for testing, and you can replace it later if you use a paid certificate.

Do not copy data yet. First confirm the empty stack works: a test page loads, the database accepts connections, and background services start on boot. Fixing a broken stack is much easier before your real data is involved. This is also the moment to set up backups on the new server, so the new home is protected from day one. Backup tools such as Restic and Borg make scheduled, incremental backups simple to run.

Step 4: Copy Files and Databases

Copy web files with a tool that preserves permissions and can resume, such as rsync over SSH. Copy the database with a proper dump, not by copying raw database files while the server runs, which can produce a corrupt copy. For large sites, copy in two passes: a big first pass days before the switch, then a short final pass on moving day to catch only what changed.

After the first copy, compare file counts and database table counts between the two servers. A mismatch usually means an uploads folder, a hidden configuration file, or a second database was missed. Check application configuration files carefully: database passwords, cache settings, and file paths often differ between servers and must be updated for the new environment.

Step 5: Test the New Server with a Temporary Hostname

Before any visitor reaches the new server, test it yourself. Point a temporary subdomain at the new server, or edit your local hosts file so your own computer resolves the real domain to the new IP. Then click through the site as a visitor would: home page, login, checkout or forms, search, file uploads, and password reset emails.

Test background work too. Run cron jobs by hand, confirm scheduled emails send, and check that error logs stay clean. If your app sends email, verify SPF, DKIM, and DMARC records for the new server’s IP, since mail providers treat a new sending IP with suspicion. The ideas behind zero-downtime deployment patterns apply here as well: never route real traffic to a version you have not exercised yourself.

Step 6: Do the Final Sync and Switch DNS

On moving day, put the old site into a brief maintenance window only if you must, or better, freeze writes for a short period. For a typical blog or brochure site, writes are rare, and a final rsync plus a fresh database dump takes minutes. For a busy store or forum, plan the switch for a quiet hour and announce it in advance.

Run the final sync, verify counts once more, then update the DNS A record (and AAAA record if you use IPv6) to the new IP. Because you lowered the TTL earlier, most visitors will reach the new server within minutes. That sequence is what a zero downtime migration looks like in practice, and dns ttl lowering done days ahead is what makes the switch feel instant. Larger setups sometimes use a database replication migration instead of a final dump, keeping the new database in step with the old one until the switch moment. Keep the old server running and unchanged for now. It is your instant rollback plan.

Step 7: Watch, Then Clean Up

Watch the new server closely for 24 to 48 hours. Check error logs, monitor load and disk space, and confirm backups and cron jobs run on schedule. If something breaks badly, you can point DNS back to the old server in minutes, because you kept it intact. That rollback option is the real reason this method is safe.

Only after a few clean days should you cancel the old server. Before cancelling, take one final backup of the old server and store it somewhere safe. Then remove the old DNS entries, close the old account, and raise the TTL back to a normal value such as 3600 seconds or higher. A higher TTL reduces DNS lookup load and is fine once you are settled.

A Practical VPS Migration Checklist

Use this vps migration checklist as the final gate before switching DNS. Every row should be checked, not assumed.

Item Check before switching
Files File counts match between servers
Database Tables and row counts match
SSL Certificate valid on the new server
Email SPF, DKIM, and DMARC pass
Cron jobs All jobs copied and tested
Backups First backup completed on the new server

Common Mistakes That Cause Downtime

The most common mistake is cancelling the old server on the same day as the switch. Keep it for at least a week. The second is forgetting email: websites move, but MX records, forwarders, and mailboxes are easy to overlook, and lost email is noticed later than a broken page. The third is skipping the local hosts file test and trusting that a copied site works. It often does, but “often” is not a plan.

How Long Does a Zero Downtime Migration Take?

For a small site, the active work is a few hours spread over a week, mostly waiting for TTLs and copies. For a large site with gigabytes of uploads, the first copy can take hours, but visitors never notice it because the old server keeps serving traffic meanwhile. The only moment that feels like a switch is the DNS change, and with a low TTL that moment is short.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.