How to Migrate a Website to VPS Without Downtime

Website migration is one of the most critical technical processes. Even a few minutes of downtime can result in lost customers, a drop in search rankings, and reputational damage. The good news is that with the right approach, you can move a website to a new VPS server with absolutely no downtime. In this article, we will walk through the entire process — from ordering a server to the final traffic switchover.
Step 1. Order a New VPS Server
Before copying anything, you need a ready destination server. In the NodexGo control panel, click the Create Server button. You will be prompted to choose a location — the real ping from your location is displayed next to each one, helping you select the point with the lowest latency for your audience. Then choose a plan that matches your site's load and an operating system image — for most web projects we recommend Ubuntu 24.04.
Set a name for the server so you do not confuse it with other machines in the panel. Choose a billing period — options of 1, 3, 6, or 12 months are available — and confirm the order. In about a minute the server will be ready: the IP address and root password will appear in the panel and will be sent to your email. Connect via SSH to make sure access is working.
ssh root@server-IP-addressCreate a server for migration in one minute
Create ServerStep 2. Lower the DNS TTL in Advance
This action must be performed 24–48 hours before the migration — while the site is still running on the old hosting. Go to the DNS settings of your domain and reduce the TTL value for the A record to 300 seconds (5 minutes). When the time comes to switch DNS to the new IP, the update will propagate worldwide in exactly that time rather than the standard 24 hours. Remember to restore the TTL to a normal value (3600 or higher) after the migration is complete.
Step 3. Set Up the Environment on the New Server
While the site is running on the old hosting, fully configure the new VPS: install the web server, the required PHP version, the database, and all necessary extensions. It is important to achieve a complete match of software versions — a discrepancy in the PHP or MySQL version can lead to hidden errors after the switchover. Update the system and install the required packages.
apt update && apt upgrade -y
apt install -y nginx php8.3-fpm php8.3-mysql mysql-serverAfter installation, configure the virtual host for your domain in Nginx or Apache exactly as it was configured on the old server. Check the configuration for syntax errors and make sure the web server starts correctly.
nginx -t
systemctl restart nginxStep 4. Copy Files and the Database
Transfer the site files to the new server using rsync — it transfers only changed files and works faster than plain scp with large amounts of data. Run the initial synchronization well in advance, and then run it again just before switching DNS to pull in the latest changes.
rsync -avz --delete /var/www/html/ root@new-server-IP:/var/www/html/For the database, create a dump on the old server and import it on the new one. If the database is being actively written to, use the --single-transaction flag for MySQL — it takes a snapshot without locking tables and without affecting site operation.
mysqldump --single-transaction -u root -p database_name > backup.sql
mysql -u root -p database_name < backup.sqlStep 5. Test the Site via the Hosts File Before Switching DNS
Before changing DNS, make sure the site on the new server is working correctly. To do this, temporarily add a mapping of the domain to the new IP address in the hosts file on your computer. This way your browser will open the site from the new server, while for all other users it will still be served from the old one.
# On Windows: C:\Windows\System32\drivers\etc\hosts
# On Linux/macOS: /etc/hosts
# Add the line:
1.2.3.4 yourdomain.com www.yourdomain.comOpen the site in your browser, go through the key pages, check forms, authentication, shopping cart functionality, and any other critical features. Make sure the SSL certificate has been obtained and HTTPS is working. Only after a successful check should you proceed to the next step.
Step 6. Switch DNS and Final Synchronization
The moment of switchover has arrived. Run a final rsync of the files and a fresh database dump to transfer the latest changes. Then update the domain's A record in DNS to point to the new server's IP. Thanks to the reduced TTL, the update will propagate within a few minutes. During this brief window some users will land on the old server and some on the new one, but both servers are running and serving current content.
Monitor the logs on the new server in real time — this allows you to instantly spot any errors. If something goes wrong, you have the option to revert DNS while the TTL is still low. Do not shut down the old server for at least 24–48 hours after the switchover — in case a rollback is needed.
tail -f /var/log/nginx/error.logUseful NodexGo Panel Tools in Case of Problems
If during the setup of the new server you accidentally lock yourself out of SSH — for example, by making a mistake in firewall rules — use the VNC web console directly in the server card in the NodexGo panel. It works independently of network settings and gives you full access to the machine. The same place has buttons for Change Root Password and Reinstall OS if you need to start from scratch. After a successful migration, once the load on the new server becomes clear, you can use the Upgrade Resources button — it moves the server to a higher plan while preserving the disk and IP address, without reinstallation.
Conclusion
Migration without downtime is not magic — it is a clear sequence of actions: lower the TTL in advance, prepare the new server in parallel with the old one running, verify everything via the hosts file, and only then switch DNS. With this approach, users will not notice any changes. If you are looking for a reliable platform for your new server, rent a VPS from NodexGo — fast deployment, a convenient control panel, and all the tools for comfortable operation are already included.
Migrate your site to a reliable VPS without downtime
Create Server