Server Administration14 min read•Updated November 2026

How to Migrate an Application to a New VPS with Minimal Downtime

Quick answer

To migrate with minimal downtime: lower the DNS TTL to about 300 seconds a day or two before, build and test the new VPS while the old one keeps serving, copy files with rsync (a full sync first, then a fast final sync), and copy the database with a dump/restore or replication. At cutover, briefly stop writes, run the final file and database sync, switch DNS, and make the old server proxy any remaining traffic to the new one until DNS propagates. Keep the old server untouched for a few days as your rollback.

Moving an application to a new server, whether for more resources, a newer OS, or a different provider, does not have to mean hours of downtime. The trick is to do almost all of the work while the old server is still live, so the actual cutover only covers the last few minutes of changes. This guide is a practical, ordered plan for a typical web application with files and a MySQL or PostgreSQL database. If you are moving off shared hosting instead, see our shared-to-VPS migration guide.

Step 0: Inventory the Old Server

Write down everything the application depends on before touching anything. Missed pieces are the main cause of failed migrations.

  • OS version, language runtimes and their versions (php -v, node -v, python3 --version, java -version).
  • Web server configuration (/etc/nginx/, /etc/apache2/), TLS certificates and redirect rules.
  • Databases, their versions and sizes (du -sh /var/lib/mysql or /var/lib/postgresql).
  • Application files and upload directories, and anything written outside them.
  • Cron jobs for every user (sudo ls /var/spool/cron/crontabs/) and files in /etc/cron.d/.
  • systemd services you added (systemctl list-unit-files --state=enabled).
  • Environment files and secrets, firewall rules, outbound integrations that whitelist your old IP (payment gateways, SMTP relays, partner APIs).

Measure real usage too (free -h, df -h, peak CPU from your monitoring) so you can size the new server. Our VPS size calculator helps if you are changing workloads at the same time.

Step 1: Lower the DNS TTL in Advance

DNS resolvers cache records for the TTL (time to live). If your A record has a TTL of 86400 seconds (one day), some visitors would keep reaching the old server for up to a day after you switch. At least one full old-TTL period before the migration, lower the TTL of the records you will change to about 300 seconds. After the migration is stable, raise it again.

dig +noall +answer example.com A    # the second column is the remaining TTL

Step 2: Build the New Server

Set up the new VPS completely before moving any data:

  1. Create an admin user with SSH keys and disable password logins (see our SSH key guide).
  2. Configure the firewall, install the same major versions of your runtime and database (or deliberately newer ones you have tested).
  3. Recreate web server configuration, systemd services, cron jobs and environment files from your inventory.
  4. Deploy the application code from your repository rather than copying it, if you can. This proves your deployment process works.

Allow SSH from the old server to the new one (an SSH key on the old server added to the new server's authorized_keys) so the two can sync directly.

Step 3: Initial File Sync with rsync

Copy uploads and other data directories while the old site keeps running:

# run on the old server
rsync -aHAX --numeric-ids --info=progress2 \
  /var/www/app/storage/ admin@NEW_IP:/var/www/app/storage/

-a preserves permissions and timestamps, -H hard links, -A/-X ACLs and extended attributes. The first run copies everything; later runs only send changes, which is what makes the final cutover fast. Mind the trailing slashes: source/ copies the directory's contents.

Step 4: Copy the Database and Rehearse

Do a full test copy now, so you know how long it takes and that the restore works:

# MySQL / MariaDB (InnoDB): consistent dump without locking tables
mysqldump --single-transaction --routines --triggers --events appdb | gzip > appdb.sql.gz
# restore on the new server
gunzip < appdb.sql.gz | mysql appdb

# PostgreSQL: custom format allows parallel restore
pg_dump -Fc -d appdb -f appdb.dump
pg_restore -d appdb --no-owner -j 4 appdb.dump

Point the new server's application at its local database and test it end to end, using a hosts-file entry on your computer to reach the new server by the real domain name:

# on your computer: /etc/hosts  (Windows: C:\Windows\System32\drivers\etc\hosts)
203.0.113.50  example.com www.example.com

Remove the entry after testing. If the dump and restore take too long for your acceptable downtime (large databases), set up replication instead: MySQL replication or PostgreSQL streaming or logical replication keeps the new database continuously in sync, so the cutover only needs to stop writes and promote the new copy.

Step 5: TLS Certificates

Let's Encrypt's HTTP challenge needs the domain to point at the new server, which it does not yet. Options:

  • Copy /etc/letsencrypt/ from the old server, so the new one has valid certificates from the first second; Certbot keeps renewing them after DNS moves.
  • Or issue new certificates with the DNS-01 challenge before the switch.

Step 6: The Cutover

  1. Announce a short maintenance window if your app accepts writes (orders, sign-ups, uploads).
  2. Stop writes on the old server: enable maintenance mode or make the app read-only. Stop cron jobs and queue workers so nothing changes behind your back.
  3. Final file sync (fast, only changes): rerun the rsync from Step 3 with --delete if files removed on the old server should also disappear.
  4. Final database copy: dump and restore again, or stop replication and promote the new database.
  5. Start the application, workers and cron on the new server and check it via the hosts-file trick.
  6. Switch DNS A/AAAA records to the new IP.
  7. Proxy leftover traffic: on the old server, change Nginx to forward everything to the new server, so visitors whose resolvers still cache the old IP reach the live system instead of a stale copy:
# old server, temporary
server {
    listen 443 ssl;
    server_name example.com www.example.com;
    ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    location / {
        proxy_pass https://203.0.113.50;
        proxy_ssl_server_name on;
        proxy_ssl_name example.com;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
    }
}

With this in place, the order of DNS propagation stops mattering: every request ends up on the new server and the new database, and nothing is written to the old copy.

Step 7: Verify

  • Log in, place a test order or submit a form, upload a file, and check emails go out.
  • Watch logs on both servers: requests on the old one should only be proxied.
  • Confirm cron jobs and queue workers run on the new server and not on the old one.
  • Update IP allow-lists at payment gateways, SMTP relays and partner APIs.
  • Check dig example.com from a few networks; propagation is complete when the old server's proxy logs go quiet.

Rollback Plan

Do not delete or modify the old server for several days. If a serious problem appears shortly after cutover, you can point DNS back. Note that writes made on the new server after cutover would need to be carried back, which is why the verification step should be thorough and quick. Once you are confident, take a final backup of the old server and cancel it.

SkyRainCloud Plans for This Workload

Size the new server from measured usage on the old one (peak CPU, RAM in use and disk), then add headroom. Moving to a plan one tier larger is a common, low-risk choice during a migration.

Intel Xeon Platinum 8269CY VPS

KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
VPS 1 — Intel28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹649/monthBusiness websites, small apps, scheduled jobs and botsOrder
VPS 2 — Intel416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,169/monthBusiness software, mid-size databases, several sites on one serverCheck stock
VPS 3 — Intel832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,249/monthERP/CRM stacks, heavier databases, multiple production appsCheck stock
VPS 4 — Intel1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,299/monthHigh-memory workloads and consolidated production serversCheck stock

AMD EPYC 7C13 VPS

Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
VPS 1 — AMD28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹649/monthWebsites, small APIs, bots, staging and VPN serversOrder
VPS 2 — AMD416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,299/monthWooCommerce, Node.js/Python backends, Docker Compose stacks, CI runnersOrder
VPS 3 — AMD832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,499/monthProduction databases, high-traffic sites, multi-container appsOrder
VPS 4 — AMD1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,899/monthLarge production workloads, SaaS platforms, analytics, in-memory cachesOrder

Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.

Common Migration Mistakes

MistakeConsequencePrevention
TTL not lowered in advanceVisitors reach the old server for hoursLower TTL at least one old-TTL period before
Writes allowed during the final syncLost orders or uploadsMaintenance mode and stop workers/cron first
Cron jobs forgottenBackups, emails or billing silently stopInventory every user's crontab and /etc/cron.d
Cron running on both serversDuplicate emails or chargesDisable cron on the old server at cutover
Old IP whitelisted by third partiesPayments or SMTP failUpdate allow-lists before or during cutover
Different database major versionRestore errors or subtle behaviour changesRehearse the restore and test the app first

Frequently Asked Questions

How long does a VPS migration take?
Preparation takes from a few hours to a few days depending on complexity. The actual downtime can be a few minutes if you pre-sync files, rehearse the database restore and lower the DNS TTL in advance.
How far in advance should I lower the DNS TTL?
At least one full period of the old TTL. If the TTL was 86400 seconds, lower it to around 300 seconds more than a day before the migration.
Can I migrate with zero downtime?
Close to it, with database replication and the old server proxying to the new one. Applications that accept writes still need a brief moment where writes stop or are redirected.
What is the best way to copy files between servers?
rsync -aHAX over SSH. Run a full sync in advance and a quick final sync during cutover; rsync only transfers what changed.
How do I move a MySQL database to a new server?
Use mysqldump --single-transaction --routines --triggers --events for InnoDB databases and import on the new server. For large databases, set up replication and promote the new server at cutover.
How do I move a PostgreSQL database?
Use pg_dump -Fc and pg_restore -j for a parallel restore, or streaming/logical replication for large databases where the dump would take too long.
What about SSL certificates during migration?
Copy /etc/letsencrypt/ from the old server, or issue new certificates with the DNS-01 challenge, so HTTPS works on the new server before DNS switches.
How do I test the new server before switching DNS?
Add a hosts-file entry on your computer pointing the domain to the new IP, test thoroughly, then remove it.
When can I shut down the old server?
After DNS has fully propagated, its proxy logs show no traffic, and you have run the application on the new server for a few days without issues. Keep a final backup.
Which SkyRainCloud plan should I migrate to?
Size it from measured usage on the old server plus headroom. If the old server was regularly short of RAM or CPU, choose the next tier up; the AMD EPYC and Intel plans offer 8, 16, 32 and 64 GB options.
Instant UPI • ₹649/mo
Fast KVM Cloud Provisioning