How to Migrate Your Website from Shared Hosting to VPS

Migrate Website from Shared to VPS

Here’s something most migration guides won’t tell you: the actual file transfer is the easy part. Anyone with cPanel access and 20 minutes can zip up a website and upload it to a new server. The difficult part, the part that takes most migrations from “afternoon project” to “weekend nightmare,” is everything that happens around the transfer. 

The DNS setting changed 24 hours too late. The hosts file test was skipped. The shared hosting account was cancelled before the global DNS finished propagating.

This guide is structured around that observation. You’ll find roughly 60% of it focused on what to do before and after the file transfer, and only about 40% on the transfer itself.

By the time you reach the actual rsync command in Step 3, you’ll already have completed the two tasks that make a smooth migration from shared hosting to a VPS possible: lowering your DNS TTL the day before and creating a backup that’s stored in two separate locations.

Why Businesses Move from Shared Hosting to VPS

Most businesses don’t move because they want to; they move because shared hosting starts holding them back. Here are the five reasons that drive almost every VPS migration.

Performance

Shared hosting splits one server’s CPU and RAM across hundreds of accounts. When a neighbor’s site gets busy, your site slows down. A VPS gives you dedicated resources that don’t fluctuate based on what anyone else is doing.

Security

On shared hosting, one compromised account on the server can expose vulnerabilities across other sites on the same machine. A VPS isolates your environment completely, letting you set your own firewall rules and security policies without depending on what other tenants are doing.

Scalability

Outgrowing a shared plan usually means starting fresh on a completely new setup. With a VPS, you can scale CPU, RAM, and storage on demand- the kind of flexibility that makes proper website migration planning easier as your traffic grows.

Root Access

Shared hosting locks down what you can install or configure. Root access on a VPS means you can run Node.js, Docker, custom PHP versions, or any software your application actually needs without filing a support ticket and hoping for approval.

Better Uptime

Shared servers go down when any account on them causes issues. VPS plans typically come with 99.9% uptime. SLAs are backed by isolated infrastructure, which is exactly why a proper VPS migration guide focuses on a move to VPS without downtime both during the migration and after it.

What is cPanel Shared Hosting?

With cPanel shared hosting, your website shares server resources with hundreds of other websites. You get a cPanel login to manage your files, email, and database, but the server’s CPU and RAM are shared among everyone on it.

It’s cheap and easy to use, which is why most people start here. But since resources are split, one busy website on the server can slow down everyone else, including you.

What is cPanel VPS Hosting?

cPanel VPS hosting gives you the same cPanel interface you’re already used to, but your website runs on its own virtual server instead of sharing space with hundreds of other sites. You get dedicated CPU and RAM that are yours alone.

This means nobody else’s traffic slows you down, and you get more control over your setup, while still keeping the same easy cPanel dashboard for managing files, email, and databases.

When Is the Right Time to Move to a VPS?

Migrating too early wastes budget. Waiting too long costs you in lost traffic, dropped rankings, and rushed decisions. 

  • Your host has emailed about resource limits: even one warning means you’re already operating at the ceiling
  • You see 503 or 508 errors during traffic spikes: these are direct symptoms of CPU or entry process limits being hit
  • Your WordPress admin takes 5+ seconds to load: backend slowness on shared hosting is a leading indicator of frontend slowness next
  • Traffic is between 20,000 and 30,000 monthly visitors: many growing WordPress hosting websites begin experiencing shared hosting resource limitations as traffic and plugin complexity increase at the same time.
  • You run WooCommerce with 50+ products: dynamic pricing, inventory checks, and cart sessions saturate shared I/O quickly
  • You need root access: installing Node.js, Docker, or custom PHP extensions isn’t possible on shared plans

If three or more of these apply, planning the migration now saves you the cost of doing it under pressure later.

Before You Touch Anything: Lower Your DNS TTL

Most people start a migration by backing up files. The smarter first move is opening your DNS settings.

Your domain’s TTL (Time to Live) tells DNS servers globally how long to remember your current IP address. The default is usually 3,600 to 86,400 seconds that’s 1 to 24 hours. Log in to your domain registrar right now and lower it to 300 seconds (5 minutes).

DNS propagation can take up to 24-48 hours globally, although lower TTL settings often allow many regions to update within minutes.

cPanel Shared to cPanel VPS Migration

Step 1: Back Up Your Files and Database

Before touching either server, get a clean copy of everything currently on shared hosting.

Download your website files

  1. Log in to cPanel and open File Manager
  2. Right-click public_html – click Compress – choose .zip
  3. Once compressed, download the zip to your computer

Export your database

  1. Open phpMyAdmin in cPanel
  2. Click your site’s database in the left sidebar
  3. Go to Export – choose Quick method, SQL format
  4. Click Go – your .sql file downloads automatically

Save both files to your computer and upload copies to Google Drive or Dropbox. Keep these somewhere safe before you make any changes; they’re your fallback if anything goes wrong on the new server.

The easier way: Full account backup

If you’d rather not zip files and export the database separately, cPanel has a built-in option that does both in one shot.

  1. Log in to cPanel and open Backup Wizard (or Backup under the Files section)
  2. Click Download a Full Website Backup
  3. Choose a backup destination (Home Directory is fine for most cases)
  4. Click Generate Backup

cPanel will bundle your files, databases, email accounts, and settings into a single archive. It takes a few minutes to generate, depending on your site size, and once it’s ready, you’ll see a download link on the same page or get an email notification.

Download this file and save a copy to Google Drive or Dropbox, just like the manual method. This single archive is actually easier to restore from later, since everything you need is already in one place.

Step 2: Get Your VPS Ready

Your VPS arrives as a clean server operating system installed, nothing else. You need a web server, PHP, and a database engine running before any files can go over.

The easiest path: managed VPS

If you’re running a standard WordPress or WooCommerce hosting site and aren’t comfortable with terminal commands, a managed VPS hosting plan typically includes server setup and, in many cases, free website migration. That means your hosting provider handles the migration for you, eliminating the need to perform Steps 3 and 4 manually.

For unmanaged VPS: install your stack

Connect via SSH and run:

Bash
sudo apt update && sudo apt upgrade -y

sudo apt install apache2 mysql-server php php-mysql -y

For a LiteSpeed setup (faster for WordPress):

Bash
sudo apt install openlitespeed -y

Then create the web root directory for your domain, a new MySQL database, and a database user with full privileges on that database. Note all three down you’ll need them in the next step.

Step 3: How Much Does the Migration Actually Cost?

Hidden costs:

  • Renewal pricing: VPS plans in India typically jump 30-60% at first renewal. Check the renewal price before paying for an annual plan.
  • Daily backup add-on: often Rs 100-400/month extra if not included in the base plan
  • Email hosting: if you’re moving away from cPanel mail, factor in Rs 50-150 per mailbox per month for a dedicated email service

For most small to mid-sized Indian websites, the total first-year cost of moving to VPS, including the plan and any one-time setup, falls between Rs 8,000 and Rs 20,000. Compared to the revenue lost to downtime and slow page speed on stretched shared hosting, that’s recovered within 2-3 months for most active business sites.

Step 4: Transfer Files and Database to the VPS and Restore 

The file transfer process varies depending on whether you’re using a control panel or a plain Linux server. Once your VPS hosting environment is ready, upload and restore all the files from the backup you created in Step 1.

Upload your website files

Option 1 FTP (easier): Open FileZilla, connect to your VPS with SSH credentials, and upload the unzipped public_html contents to /var/www/yourdomain.com.

Option 2 – rsync via SSH (faster for sites over 1GB):

Bash
rsync -avz ./public_html/ username@YOUR_VPS_IP:/var/www/yourdomain.com/

Import your database

Upload the .sql file to your VPS and run:

Bash
mysql -u your_db_user -p your_database_name < /tmp/site-database.sql

Update wp-config.php

Open wp-config.php on the VPS and update these four values:

PHP
define('DB_NAME', 'your_new_database_name');
define('DB_USER', 'your_new_db_user');
define('DB_PASSWORD', 'your_new_db_password');
define('DB_HOST', 'localhost');

Then set the correct file permissions so your web server can read the site:

Bash
sudo chown -R www-data:www-data /var/www/yourdomain.com/

sudo find /var/www/yourdomain.com -type d -exec chmod 755 {} \;

sudo find /var/www/yourdomain.com -type f -exec chmod 644 {} \;

Step 5: Test Your Site on the VPS Without Changing DNS

This is the step that makes the difference between a smooth go-live and a late-night debugging session. You can preview your site running on the VPS fully without changing a single DNS record. Only your computer sees the VPS. Everyone else still visits the shared hosting as normal.

How to preview the VPS on your own machine

On Windows: Open Notepad as administrator → open C:\Windows\System32\drivers\etc\hosts

On Mac or Linux: Run sudo nano /etc/hosts in Terminal

Add this line at the bottom (use your actual VPS IP and domain):

203.0.113.50   yourdomain.com www.yourdomain.com

Open your browser and visit your domain. You’re now browsing the VPS. Nobody else is.

What to check before you approve the move

Go through each of these before removing the hosts file entry:

  • Every page loads cleanly with no errors or broken styles
  • Contact forms send emails successfully
  • Any payment or checkout flow works from start to finish
  • SSL certificate is active – no browser security warnings.
  • WordPress admin panel logs in and works normally
  • Images and uploaded files display correctly

Once you’ve ticked every box, delete the line you added to the hosts file. Your site on the VPS is ready to go live.

Step 6: Switch DNS and Go Live

Your TTL is already low from the preparation step. Now update the A record.

  1. Log in to your domain registrar GoDaddy India, Namecheap, BigRock, or wherever your domain is registered
  2. Find DNS Settings → locate the A record for your root domain
  3. Replace the current IP with your VPS IP address and save

Watch it propagate in real time using whatsmydns.net – paste your domain, and you’ll see the new IP resolving from different global locations as it spreads. With a low TTL, most regions update within 5 to 15 minutes.

Keep your shared hosting plan active and do not delete anything from it for at least 48 hours. Some DNS servers hold on to your old IP longer than others. Your shared hosting being live during this window means those visitors still reach a working site instead of an error page.

Common Migration Problems and Fixes

Even careful migrations sometimes run into one of these. Here’s what causes each one and how to fix it.

Problem Cause Fix
“Error establishing a database connection” Wrong values in wp-config.php or the SQL import failed. Check that DB_NAME, DB_USER, and DB_PASSWORD match your VPS database exactly.
500 Internal Server Error Incorrect file permissions. Re-run the chown and chmod commands from Step 3.
SSL shows “Not Secure” SSL certificate is not installed. Run sudo certbot --apache -d yourdomain.com to install a free Let’s Encrypt certificate.
Emails are not being sent The VPS provider blocks PHP mail() by default. Use the WP Mail SMTP plugin with Gmail or another SMTP service.
Images are broken or CSS is missing The WordPress site URL still points to the old server. Run in phpMyAdmin:
UPDATE wp_options SET option_value='https://yourdomain.com' WHERE option_name IN ('siteurl','home');
Blank white screen Plugin conflict or insufficient PHP memory. Temporarily rename the /wp-content/plugins folder to disable all plugins, then reactivate them one by one.

Conclusion

Most people consider a migration successful the moment the site loads on the new server. That’s the wrong finish line. Lower server response times can contribute to improved Core Web Vitals performance, particularly Largest Contentful Paint (LCP). Those are the outcomes the migration was intended to achieve.

FAQs:

How long does moving from shared hosting to VPS actually take? 

The file transfer, database import, and configuration take 2 to 4 hours for most sites. DNS propagation after the switch takes between 15 minutes and 48 hours depending on your domain registrar. and depends on the website data size.

Will my site go offline during the migration? 

Not if you test on the VPS before switching DNS. Your shared hosting stays live throughout. The only downtime risk is switching DNS before verifying the VPS is working, which is why Step 4 exists.

Do I need to know how to code to migrate to a VPS? 

No coding required, but you’ll need to be comfortable with cPanel, FTP, and editing a text file (wp-config.php). If that sounds like too much, a managed VPS plan typically includes migration as part of the setup.

Can I host more than one website on the same VPS? 

Yes. A single VPS handles multiple sites in separate web root folders, each with its own database. Your control panel or web server configuration directs each domain to the right folder.

What should I do about email accounts during migration? 

If your email runs through your shared hosting (cPanel mail), set up new mailboxes on the VPS before switching DNS. Export your existing emails via IMAP using a mail client like Thunderbird so no messages get lost in the transition.

How do I know the migration actually improved my site’s performance?

Check Google Search Console → Core Web Vitals after 30 days. You should see TTFB drop and LCP improve. You can also run your URL through PageSpeed Insights before and after to compare scores.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
How to Secure a VPS

How to Secure a VPS Server: Complete VPS Security Guide for 2026

Related Posts