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/mysqlor/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:
- Create an admin user with SSH keys and disable password logins (see our SSH key guide).
- Configure the firewall, install the same major versions of your runtime and database (or deliberately newer ones you have tested).
- Recreate web server configuration, systemd services, cron jobs and environment files from your inventory.
- 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
- Announce a short maintenance window if your app accepts writes (orders, sign-ups, uploads).
- 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.
- Final file sync (fast, only changes): rerun the rsync from Step 3 with
--deleteif files removed on the old server should also disappear. - Final database copy: dump and restore again, or stop replication and promote the new database.
- Start the application, workers and cron on the new server and check it via the hosts-file trick.
- Switch DNS A/AAAA records to the new IP.
- 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.comfrom 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.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| VPS 3 — Intel | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check 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.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
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
| Mistake | Consequence | Prevention |
|---|---|---|
| TTL not lowered in advance | Visitors reach the old server for hours | Lower TTL at least one old-TTL period before |
| Writes allowed during the final sync | Lost orders or uploads | Maintenance mode and stop workers/cron first |
| Cron jobs forgotten | Backups, emails or billing silently stop | Inventory every user's crontab and /etc/cron.d |
| Cron running on both servers | Duplicate emails or charges | Disable cron on the old server at cutover |
| Old IP whitelisted by third parties | Payments or SMTP fail | Update allow-lists before or during cutover |
| Different database major version | Restore errors or subtle behaviour changes | Rehearse the restore and test the app first |
Frequently Asked Questions
How long does a VPS migration take?
How far in advance should I lower the DNS TTL?
Can I migrate with zero downtime?
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?
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?
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?
/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.