New customers get 20% OFF the first month with code

Back to blog

How to Migrate Your Website to a VPS With No Downtime

A simple step by step guide to move your website to a VPS without your visitors noticing.

How to Migrate Your Website to a VPS With No Downtime

Moving your website to a VPS sounds risky, but with a little planning you can migrate with zero downtime. The key is to fully set up and test the new server before pointing your domain at it. Follow these steps with the exact commands.

1. Set up and secure the VPS

Provision the VPS and install the same stack your site uses. Lock it down from the start.

sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable

2. Copy your files with rsync

rsync only transfers what changed, so you can run it again later for a fast final sync.

rsync -avz --progress /var/www/mysite/ user@NEW_VPS_IP:/var/www/mysite/

3. Move the database

Export the database on the old server, copy it over, and import it on the VPS.

# on the old server
mysqldump -u dbuser -p mydb > mydb.sql
scp mydb.sql user@NEW_VPS_IP:~

# on the new VPS
mysql -u dbuser -p mydb < mydb.sql

4. Test before switching

This is what gives you zero downtime. Point your own machine to the new server with a hosts file entry and browse the real domain before touching public DNS.

# add to /etc/hosts (Windows: C:\Windows\System32\drivers\etc\hosts)
NEW_VPS_IP   example.com www.example.com

Check pages, forms, logins, and the database until everything works.

5. Lower the DNS TTL

A day before the switch, set the TTL on your DNS records to 300 seconds so the change propagates quickly.

6. Final sync and switch

Run rsync once more to catch recent changes, then update DNS to the new IP.

rsync -avz --progress /var/www/mysite/ user@NEW_VPS_IP:/var/www/mysite/
# then point your A record to NEW_VPS_IP

Because you tested everything and lowered the TTL, traffic shifts over smoothly. Keep the old server for a day or two as a safety net.

Getting started

Pevnix Cloud VPS in Singapore gives you fast NVMe servers, dedicated resources, and DDoS protection, making migrations painless.

Pevnix Team

Written by

Pevnix Team

Published on July 02, 2026

The Pevnix team shares practical guides on hosting, VPS, and web technology to help you launch, secure, and scale your projects with confidence.

Did you find this blog helpful?

Back to blog

Shared by the Pevnix team

Take Your Business Online Today

Experience fast and reliable hosting with Pevnix. Get started in minutes.

Explore Plans

© 2026 Pevnix. All rights reserved.

Pevnix is a brand of Asia Cloud Hosting, registered in Singapore.

Secured by stripe