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.