How to Migrate from Shared Hosting to a Dedicated Server (Zero Downtime)

Introduction

You've outgrown shared hosting. Your site is slow, you're hitting resource limits, and you need full control over the server environment. Moving to a dedicated server is the right call โ€” but the migration itself can be daunting. Get it wrong, and you're looking at extended downtime, broken applications, and frustrated users.

This guide walks through a proven, zero-downtime migration process. We've used it for dozens of migrations โ€” including our own move from cloud VPS to our bare metal infrastructure.

Phase 1: Planning & Preparation

Before touching any servers, gather information and create a rollback plan. A proper migration is 80% planning and 20% execution.

Step 1: Audit Your Current Environment

Document everything about your current setup:

  • Server software โ€” Web server (Apache/Nginx/Caddy), language runtimes (PHP version, Node.js version, Python version), database (MySQL/MariaDB/PostgreSQL version)
  • Installed packages โ€” All system packages, PECL extensions, npm/Composer/Pip global packages
  • Application configuration โ€” Environment variables, config files, .htaccess rules, cron jobs, systemd services
  • SSL certificates โ€” List domains with certificates, expiry dates, and renewal methods
  • Storage usage โ€” Total disk usage by directory, database sizes
  • Traffic patterns โ€” Peak hours, average concurrent users, bandwidth usage

Run dpkg --get-selections > packages.txt (Debian/Ubuntu) or rpm -qa > packages.txt (RHEL/CentOS) to capture all installed packages.

Step 2: Order & Configure Your Dedicated Server

When ordering your dedicated server at Hostingowy, specify:

  • Same or newer OS version as your current environment
  • Matching or higher PHP/MySQL/other runtime versions
  • Additional IP addresses if you serve multiple SSL sites
  • NVMe storage configuration (we use ZFS with compression)

Our provisioning system deploys dedicated servers in under 15 minutes. Once it's ready, run our getting started guide to install your required software stack.

Step 3: Set Up a Staging Copy

Before cutting over production traffic, build a staging replica of your environment on the new server. This lets you:

  • Test that all applications work correctly
  • Benchmark performance on the new hardware
  • Validate configuration differences
  • Train your team on the new environment

Phase 2: Data Transfer

Step 4: Transfer Application Files

Use rsync for efficient, resumable file transfers:

# Initial sync (run during low-traffic hours)
rsync -avz --progress --delete \
  root@old-server:/var/www/ \
  /var/www/

# Final sync (just before cutover, will be fast due to incremental)
rsync -avz --progress --delete \
  root@old-server:/var/www/ \
  /var/www/

The first sync transfers everything. The second sync (run immediately before cutover) only transfers changed files, typically taking seconds.

Step 5: Transfer Databases

For MySQL/MariaDB, use mysqldump with compression:

# On old server: dump all databases
mysqldump --all-databases --single-transaction \
  --routines --triggers --events | gzip > db_dump.sql.gz

# Transfer to new server
scp root@old-server:~/db_dump.sql.gz /tmp/

# On new server: restore
gunzip < /tmp/db_dump.sql.gz | mysql -u root -p

For PostgreSQL, use pg_dumpall. For both, take a final incremental transfer just before cutover (using binary logs or WAL archiving).

Step 6: Transfer SSL Certificates & Configuration

Copy SSL certificates and site configuration files:

# Copy SSL certificates
rsync -avz root@old-server:/etc/letsencrypt/ /etc/letsencrypt/

# Copy web server configs
rsync -avz root@old-server:/etc/nginx/ /etc/nginx/
# Or for Apache:
rsync -avz root@old-server:/etc/apache2/ /etc/apache2/

# Copy systemd service files
rsync -avz root@old-server:/etc/systemd/system/*.service \
  /etc/systemd/system/

Phase 3: Cutover

Step 7: Final Data Sync

Put your application in maintenance mode (or scheduled downtime for write-heavy apps). Run the final rsync and database dump to capture any last changes. This window should be under 5 minutes if you've done the preparatory syncs.

Step 8: Start Services on New Server

systemctl restart nginx php8.2-fpm mysql
systemctl status nginx php8.2-fpm mysql

Verify all services are running and application health checks pass.

Step 9: Update DNS

Lower your DNS TTLs a few days before migration (e.g., from 3600 to 60 seconds). On cutover day:

  • Point your domain's A record (or CNAME) to the new server's IP
  • Update any other DNS records (MX, TXT, etc.) as needed
  • Monitor DNS propagation using dig or whatsmydns.net

Most DNS changes propagate within 5-15 minutes with low TTLs. Keep both servers running for at least 48 hours post-migration to catch late-propagating requests.

Phase 4: Validation & Rollback Planning

Step 10: Post-Migration Verification

Check these critical items after cutover:

  • SSL certificates are valid and auto-renewal is working
  • All redirect rules and URL rewrites work correctly
  • Cron jobs are running on schedule
  • Email delivery (if self-hosted) is working
  • Backup scripts are configured and running
  • Monitoring alerts are configured for the new server

Step 11: Rollback Plan (Just in Case)

If something goes wrong, your rollback is straightforward:

  1. Update DNS records back to the old server IP
  2. Restart services on the old server
  3. Import any data written on the new server back to the old one

Keep both servers running for at least 7 days after migration. The cost of a few extra days of server time is far less than the cost of an unsuccessful migration.

Common Pitfalls to Avoid

  • Skipping the staging test โ€” Always test on the new server before cutting over production traffic
  • Ignoring PHP version differences โ€” PHP 8.0 code doesn't always work on PHP 8.2. Test for deprecation warnings.
  • Forgetting cron jobs โ€” crontab -l lists user crons. Don't forget system crons in /etc/cron.*
  • SSL certificate validation โ€” Wildcard certs and Let's Encrypt certs need proper DNS validation on the new server
  • Firewall rules โ€” Don't forget to configure iptables/nftables on the new server

Let Us Handle Your Migration

At Hostingowy, we offer free migration assistance for all dedicated server plans. Our engineering team handles the entire migration process โ€” from environment audit to DNS cutover โ€” with guaranteed zero downtime. Contact our sales team to get started.

Ready to Upgrade to Dedicated?

Bare metal servers from $1,500/mo. Free migration, zero downtime.

Explore Dedicated Plans

Enterprise SLA: 99.95% uptime, 4-hour hardware replacement

Hostingowy Engineering
Infrastructure Team
๐Ÿš€

The Hostingowy Engineering Digest

Get monthly deep-dives on UK VPS hosting, infrastructure benchmarks, DevOps tooling, and cloud cost optimisation. Built by engineers, for engineers.

2 issues sent ยท 7 subscribers ยท No spam, ever

No spam. Unsubscribe anytime. Read our Privacy Policy.