How to Migrate a Website to a VPS Without Downtime

Nov 12, 2026

overview

To move a website to a VPS without downtime, build and test the new server first, lower your DNS TTL a day or two before the move, copy the files and database, do a final sync, then switch DNS while the old server keeps running.

Visitors are never sent to an empty server, because the old one stays online until DNS has fully moved over. The two things that cause most migration downtime are a high DNS TTL and forgetting the final database sync.

Moving a live website feels risky because it is: one wrong step and visitors see an error page, orders go missing or emails stop arriving. The good news is that a website migration is a well understood process. Done in the right order, your visitors should not notice anything except, hopefully, a faster site.

This is the checklist we would follow ourselves when moving a site onto a new VPS. It works whether you are coming from shared hosting, another VPS provider or an old server in the office, and it applies to Linux and Windows servers alike.

What does "zero downtime migration" really mean?

A zero downtime migration means your website stays reachable for the whole move. The trick is simple: you never switch off the old server until the new one is fully ready and DNS has moved every visitor across. For a while, both servers run in parallel. Some visitors still reach the old one, some reach the new one, and both serve the same site.

The only part that needs real care is anything that changes during the move, such as new orders, comments, form submissions or user accounts. That is why the database gets a final sync at the very end.

Step 1: Take an inventory of what you are moving

Before touching anything, write down everything the site depends on. This is the step people skip, and it is where surprises come from later.

Your pre-migration inventory

  • Files: the website code, uploads, images and any configuration files.
  • Databases: names, sizes, users and passwords (MySQL, MariaDB, PostgreSQL or SQL Server).
  • Software versions: web server, PHP, Node.js, .NET or other runtimes, so the new server matches.
  • Scheduled jobs: cron jobs or scheduled tasks that send emails, run backups or clean up data.
  • DNS records: A, AAAA, CNAME, MX and TXT records, and who controls the DNS.
  • Email: whether email is hosted on the same server or with a separate provider.
  • SSL certificates: where they come from and how they are renewed.

Step 2: Choose the right VPS size

Size the new server on what the site actually uses, with headroom for traffic peaks. Check current CPU, RAM and disk usage on the old host, and plan for at least 30 to 50 percent more than the average. Our guide on how to read a VPS spec sheet explains which numbers matter, and if you are unsure about the operating system, see Linux vs Windows VPS.

Step 3: Lower your DNS TTL a day or two before the move

This is the single most important step for avoiding downtime. TTL (time to live) tells resolvers around the world how long they may cache your DNS records. If your TTL is 24 hours, some visitors could keep going to the old server for up to a day after you switch. Lower it to around 5 minutes (300 seconds) at least 24 to 48 hours before the move, so the old, longer value has expired everywhere by migration day.

How long visitors may keep reaching the old server after a DNS change (maximum cache time by TTL)

■ Longer bar = more visitors stuck on the old server

TTL 86,400 seconds (up to 24 hours)
 
TTL 14,400 seconds (up to 4 hours)
 
TTL 3,600 seconds (up to 1 hour)
 
TTL 300 seconds (up to 5 minutes)
 

Resolvers can cache a record for up to its TTL. Lower it in advance and the switch takes minutes, not hours.

Step 4: Build and secure the new server

Set up the new VPS completely before moving any data: install the same software versions, configure the web server, create database users, set up the firewall and lock down remote access. Our VPS production checklist covers the security basics, and if you are moving to Windows, follow our guide to securing RDP on a Windows VPS. If you would rather not handle server setup yourself, read managed vs unmanaged VPS first.

Step 5: Copy the files and the database

Copy the website files with a tool that can resume and sync changes, such as rsync on Linux or Robocopy on Windows. Export the database from the old server (for example with mysqldump or pg_dump) and import it on the new one. At this stage the old site is still live and serving visitors, so take your time and do it properly.

Step 6: Test the new server before anyone sees it

You can test the new server under your real domain without changing DNS. Edit the hosts file on your own computer so your domain points to the new server’s IP address. Only your machine will see the new server. Click through the site, log in, submit a form, place a test order and check that images, emails and SSL all work. When everything passes, remove the hosts file entry.

Migration method Downtime risk Skill needed Best for
Manual copy (rsync + database dump) Low Medium Most websites
Hosting panel migration tool Low Low Sites on cPanel or Plesk
Full server image or snapshot Medium High Complex custom servers
Database replication + cutover Very low High Busy shops and apps

Step 7: Do a final sync, then switch DNS

Now pick a quiet time. If your site takes orders or user content, put it in maintenance mode or pause writes for a few minutes. Run a final rsync and a fresh database export and import, so the new server has the very latest data. Then update your DNS A record (and AAAA record for IPv6) to the new server’s IP address. With a low TTL, most visitors move across within minutes.

A short, real world example

An online shop with a few hundred orders a day moves from shared hosting to a VPS. Two days before, the owner lowers the DNS TTL from 4 hours to 5 minutes. The new VPS is built, tested through the hosts file and ready by Thursday. At 6am on Friday, the quietest hour, the shop goes into maintenance mode for eight minutes: a final file sync, a fresh database export and import, and the DNS change. By 6:15 almost all traffic is on the new server. The old host keeps running until Monday, catches two stray orders from cached visitors, and those are copied across by hand. Customers notice nothing except faster page loads.

Step 8: Keep the old server running, then clean up

Do not cancel the old hosting on migration day. Keep it running for at least 48 to 72 hours while the last cached visitors move over, and watch its logs for any traffic still arriving. Once it goes quiet, take a final backup, cancel the old service and raise your DNS TTL back to a normal value such as one hour.

What are the most common migration mistakes?

Mistakes that cause downtime

  • Forgetting to lower the DNS TTL in advance.
  • Skipping the final database sync, so orders or sign ups made during the move are lost.
  • Moving the MX record by accident and breaking email.
  • Not testing SSL on the new server before switching DNS.
  • Forgetting cron jobs or scheduled tasks, so backups and emails silently stop.
  • Cancelling the old hosting too early.

How hosting662 fits

hosting662 VPS plans give you full root (or RDP) access, Ceph SSD storage across three clusters, a dedicated IPv4 address and daily backups, in our own datacenter in the European Union. That makes them a solid destination for a migration: you control the whole setup, and the infrastructure underneath is built for uptime. If location matters for your visitors or for compliance, our guide to European VPS hosting explains why. Compare plans on our VPS hosting page.

Planning a move?

Full root access, Ceph SSD storage, dedicated IPv4 and daily backups in our own EU datacenter.

See VPS plans

Frequently asked questions

Can I move my website to a VPS without downtime?

Yes. Build and test the new VPS first, lower your DNS TTL a day or two before, copy the files and database, do a final sync, then switch DNS while the old server keeps running. Visitors are served by one server or the other throughout, so the site stays online.

How long does a website migration to a VPS take?

The hands-on work for a typical website takes a few hours, spread over several days: lowering the DNS TTL 24 to 48 hours before, building and testing the new server, then a short final sync and DNS switch. Keep the old server running for 48 to 72 hours afterwards.

What TTL should I set before migrating?

Lower your DNS TTL to around 300 seconds (5 minutes) at least 24 to 48 hours before the migration. This makes the DNS change take effect quickly for most visitors. After the move, raise it back to a normal value such as 3,600 seconds (1 hour).

Will moving to a new server affect my email?

Only if email is hosted on the same server or you change the MX records. If your email is with a separate provider, leave the MX records untouched and email keeps working. If email is on the old server, plan its move as a separate step.

How do I test a new server before switching DNS?

Edit the hosts file on your own computer so your domain points to the new server’s IP address. Only your computer will load the new server, so you can check pages, logins, forms, checkout and SSL under your real domain before any visitor sees it.

The bottom line

Migrating a website to a VPS without downtime comes down to order and patience: inventory first, lower the TTL early, build and test the new server while the old one stays live, finish with a final sync and a DNS switch, and keep the old server running for a few days. Follow those steps and your visitors should never notice the move.

Looking for a reliable new home for your site? See hosting662 VPS plans, with full root access and daily backups in our own EU datacenter.

Comments

No comments yet. You can be the first.

Leave a comment

Comments are moderated before they appear on the site.