Loading Smiley Hoster
Skip to content

Migrate a website to a new VPS with rsync and a tested DNS cutover

Smiley Hoster Team · · 3 min read
A timeline connects DNS preparation, file copying, testing and the switch to a new VPS.

Vultr's migration guidance puts application testing before DNS cutover. This procedure turns that sequence into a repeatable VPS move, with one essential boundary: rsync transfers files, not a live database's consistency.

1. Decide how both servers will serve valid data

Record the domain's A and AAAA records, runtime versions, extensions, scheduled jobs, database and session storage. Back up the site and prepare the replacement VPS with the required application stack and virtual host. Keep the original online.

Lower the relevant DNS TTL, for example to 300 seconds where supported. Wait at least the previous TTL before switching addresses; lowering it does not expire answers already cached. Save the original records for rollback.

Example
dig +noall +answer example.com Adig +noall +answer example.com AAAA

Pick the data strategy before copying:

  • For a static site, pause content changes until migration finishes. Reading can continue on both servers.
  • For uninterrupted writes on a dynamic site, both frontends need coherent shared storage, compatible sessions and only one execution of each scheduled task. Prepare this over a secured private network.
  • Moving a local database as well requires database-specific replication and promotion for continuous writes. An export/import with writes paused is an alternative, but does not provide complete uninterrupted service.

2. Copy the site and rehearse the new route

Install rsync on both hosts. Run the following on the old VPS with an account that can read the source. On the new VPS, deploy must have write access to the dedicated destination /srv/site/. Replace NEW_IP and verify its SSH host key.

Example
rsync -azn --itemize-changes /var/www/site/ \ deploy@NEW_IP:/srv/site/rsync -az /var/www/site/ deploy@NEW_IP:/srv/site/

The trailing slash copies the source directory's contents. Point the new virtual host at that destination and set ownership and permissions for its web service. Never substitute a copy of a running database's data directory for a database migration.

Install a valid domain certificate on the destination before testing HTTPS. A DNS challenge can establish it before the A record moves; arrange automated renewal too.

Temporarily map the domain to the new IP in your workstation's hosts file:

Example
203.0.113.20 example.com

Replace that documentation address. The file is /etc/hosts on Linux/macOS and C:\Windows\System32\drivers\etc\hosts on Windows; editing needs administrator privileges.

Check pages, login, images and application operations using the real hostname. An explicit command avoids ambiguity from cached DNS answers:

Example
curl --resolve example.com:443:203.0.113.20 \ -I https://example.com/

Do not add -k; certificate errors are part of the acceptance test.

3. Complete synchronization and change DNS

Once writes are controlled by your chosen strategy, preview the final file synchronization. The delete option removes destination files missing from the source, so use it only for the dedicated, backed-up site directory.

Example
rsync -azn --delete --itemize-changes \ /var/www/site/ deploy@NEW_IP:/srv/site/rsync -az --delete \ /var/www/site/ deploy@NEW_IP:/srv/site/

Update A and any AAAA record. Remove the hosts override, test from another network, and compare access and error logs on both servers. Keep the old endpoint serving until observed residual traffic has drained; a five-minute TTL is not a universal deadline.

Common failures: leaving IPv6 on the old machine, duplicating cron jobs, switching before TLS works or reverting DNS after the databases diverge. Restoring the old IP is safe only while that frontend can still serve current data.

After acceptance, restore the intended TTL and retire the old VPS according to your retention plan. The final check is a working public site with consistent data, not merely a new address in a DNS lookup.

Sources: Vultr migration preparation, Vultr pre-cutover testing.

Slide 1 of 5: VPS migration. Test first. Then switch DNS.. Move website files with rsync. Plan data consistency before the cutover.
Slide 2 of 5: Prepare the move. Plan for consistent data. Back up the site and keep the old VPS online. Lower DNS TTL, then wait at least the previous TTL. Choose how to handle writes: rsync copies files, not a live database's consistency.
Slide 3 of 5: Rehearse the route. Copy files. Test HTTPS.. Dry-run rsync before copying. Install a valid domain certificate on the new VPS. Use a hosts override to test pages, login, images and app operations with the real hostname.
Slide 4 of 5: Make the cutover. Switch DNS. Watch traffic.. Control writes and finish synchronization. Update A and AAAA records, remove the hosts override and test from another network. Keep the old VPS serving current data until residual traffic drains.
Slide 5 of 5: Keep rollback viable. A new IP is not enough.. Rollback is safe only while the old frontend can serve current data. Read the full guide for commands and checks.
On social media

See it in our social posts

The key steps of this article, as a carousel. Follow us to catch the next ones.

Did this article answer your question?
Your feedback shapes what we write next.

Your site online today

Free migration* · 30-day refund

Get started* A site under 30 GB, cPanel, WordPress and VPS plans.