Moving a VPS to another host without downtime
When you change hosts, your server gets a new IP address, and that is the main thing to plan around. There will be no downtime if the new server is ready and tested before the switch, the data is synced in advance, and the old server keeps accepting requests for a while. Below: the order of steps, the timing, and what most often breaks during a move.
The short answer. You set up the new server alongside the old one, copy the data over and test it while the site keeps running on the old server. On moving day you stop writes for a few minutes, copy the last changes and point DNS at the new address. For another week the old server forwards requests to the new one, so nobody lands on a stale copy.
Why your IP address will not move with you
IP addresses belong to the host: it gets them in blocks from a regional internet registry and lends them to customers. Only a company with its own address blocks and its own autonomous system can take its addresses along, and that never applies to an ordinary VPS. So everything rests on DNS: visitors and services find the server by name, and the move is the moment the name starts pointing to the new address. Within one host an address can be moved between your own servers (a floating IP, see Floating IP and Load Balancer), but it will not move to another host.
Before the move, find the places where the old IP is written directly rather than through a name:
- allowlists at partners, payment systems and banks, IP-based access to other companies' APIs — warn them in advance, they may need several days;
- the domain's SPF record if the server sends mail, and the reverse PTR record, which the new host sets up;
- the server's own settings: configuration files, environment variables, firewall rules, database connections by address;
- monitoring and external uptime checks.
The move, day by day
| When | What to do |
|---|---|
| 2–3 days before | Lower the TTL of the domain's records to 300 seconds. Order the new server and list everything that runs on the old one. |
| 1–2 days before | Build the new server, copy the files in a first pass, start the database copy. Test the site on the new server through the hosts file. |
| Moving day | Stop writes, copy the remaining changes, switch DNS, turn on proxying on the old server. |
| The week after | Watch the logs on both servers, restore the TTL, shut down the old server once requests stop reaching it. |
TTL (time to live) is how long ISPs' DNS servers cache a record. If it is currently set to a day, lower it at least a day before the move; otherwise some visitors will keep going to the old address for another day. More on records and TTL in the article domains and DNS for server owners.
Disk image or a fresh build
There are two ways to get the same system on the new server. The first is to transfer the whole disk image. That works if the new host lets you upload your own image or install the system from your own ISO. In the accsly catalog on 14 November 2026 this is confirmed at 325 of 1,857 VPS hosts; see the selection VPS with custom ISO. After moving an image you almost always have to fix the network settings: the new host has a different address, gateway and sometimes a different network interface name.
The second way is to install the system from scratch and move only the data and settings. It takes longer but is cleaner: the clutter of years does not move with you, and you also prove that the server can be rebuilt from zero. If your applications already run in containers, this path is shorter: on the new server you just install Docker and copy over the compose files and data volumes.
Files: syncing in several passes
When run again, rsync transfers only the files that have changed. That is what makes a move without a long stop possible:
- First pass: everything, while the site is running. With hundreds of gigabytes it can take hours, and that is fine.
- Second pass: the day before or an hour before the switch. Only changes are transferred, usually in minutes.
- Final pass: after writes are stopped, with the
--deleteoption, so that files deleted on the old server are also deleted on the new one. It takes seconds.
User uploads, cache and sessions live in different directories. You can skip the cache, but file-based sessions are lost in a move, and users will have to log in again. If that matters, move sessions to the database or Redis in advance.
Database: dump or replication
You cannot copy a running database like ordinary files: the copy will be inconsistent. There are two ways to do it.
A dump with a short write freeze. Suits databases of up to a few gigabytes. The site goes read-only or shows a "maintenance in progress" page, the database is exported, transferred and imported on the new server. Writes are down for as long as the export and import take, so time this in advance in a test run.
Replication. For large databases the new server is connected to the old one as a replica and catches up with all changes in real time. In PostgreSQL, logical replication is convenient for moving between servers because it works across different versions. According to the documentation, it does not carry the database schema, so you transfer that first with pg_dump --schema-only. Sequence values (the id counters) are not carried either, and you must set them by hand before the switch; otherwise new rows will get numbers that are already taken. MySQL and MariaDB use ordinary replication based on the change log. At switchover you stop writes on the old server, wait for the replica to catch up and point the application at the new database. Writes are down for less than a minute.
How to set up the databases themselves on a VPS is covered in the article PostgreSQL and MySQL on a VPS.
Testing before the switch
You can test the new server before changing DNS: add the domain with the new address to the hosts file on your computer and open the site. Walk through the key scenarios: logging in, placing an order, uploading a file, submitting a form. Make sure the application writes to the new database and does not reach the old one through an address in its configuration.
The certificate is a separate issue. Let's Encrypt validates the domain over port 80 at the address in DNS, so before the switch the new server cannot get a certificate that way. There are two ways out: copy the current certificate from the old server, or issue a new one through DNS record validation, which does not depend on where the domain points.
Moving day
- Stop writes: maintenance mode, stop queues and cron jobs on the old server.
- Run the final rsync pass and the final dump, or wait for the replica to catch up.
- Start the application, queues and cron on the new server. Scheduled jobs must not run on two servers at once, or emails will go out twice and reports will be calculated twice.
- Change the A records (and AAAA records if you have IPv6) to the new addresses.
- On the old server, configure the web server to forward all requests to the new one. Visitors who still have the old address cached will reach the new server and will not write anything to the old database.
With a TTL of 300 seconds, most traffic moves to the new server within a few minutes. The rest, from software and ISPs that keep records longer than they should, keeps arriving at the old server for several days and is forwarded on.
If the server handles mail, the MX record is changed the same way as the A record. No mail is lost: a sending server that cannot reach the recipient keeps retrying, and under RFC 5321 it should not give up for at least 4–5 days. Mailboxes are moved with the same rsync or over IMAP. Before the switch, add the new address to SPF and ask the new host to set up PTR; otherwise mail from the new server will start landing in spam.
How long to keep the old server and how to roll back
Keep the old server running for at least a week. As long as it is up and its data is intact, a rollback means restoring the A records and stopping the new server. If new orders or messages have already arrived on the new server, they have to be moved back, so it is better to decide on a rollback within the first hours. Before shutting the old server down, make a final copy of it to separate storage; for the difference between a host snapshot and a backup, see the article snapshots and backups.
A week of running two servers costs money, and hourly billing helps here: in the accsly catalog it is confirmed at 159 VPS hosts; see the selection VPS with hourly billing. With hourly billing you can do a trial move on a new server, rehearse the switch and delete the server, paying only for the hours used. How to end the contract with your old host and get the remaining balance back is covered in the article how to leave a host without losses.