How to Move WordPress from Shared to VPS Hosting – Step‑by‑Step Guide 2026

By Joy Jacob · Updated 2026-05-07 · 4 min read

How to Move WordPress from Shared to VPS Hosting – Step‑by‑Step Guide 2026 — AI Money Hub

Sponsored

Introduction

Running a WordPress site on shared hosting is a great starting point, but as traffic grows you’ll notice constraints: limited CPU, slower databases, and restricted security controls. Switching to a Virtual Private Server (VPS) gives you dedicated resources, full root access, and the ability to fine‑tune performance. In this guide we walk you through the entire migration process—pre‑migration checklist, backing up your site, moving files and databases, updating DNS, and testing on the new server—all optimized for 2026 standards.

1. Why Upgrade to VPS?

Before diving into the technical steps, understand the tangible benefits:

2. Pre‑Migration Checklist

Skipping preparation is the fastest way to encounter downtime. Follow this checklist:

Task Why It Matters Tools/Commands
Confirm VPS specs (CPU, RAM, SSD, bandwidth) Ensures the new server can handle current + future load Provider dashboard (e.g., DigitalOcean, Linode)
Backup WordPress files & database Prevents data loss in case of migration errors cPanel backup, mysqldump, rsync
Check PHP & MySQL versions Compatibility with plugins & themes php -v, mysql -V
Set up a temporary sub‑domain on VPS Allows testing without affecting live traffic DNS A‑record, nginx config
Review plugins for server‑level dependencies Some plugins need specific extensions (e.g., GD, Imagick) Plugin docs, php -m

3. Step‑by‑Step Migration Process

3.1. Purchase & Prepare Your VPS

  1. Choose a reputable provider (DigitalOcean, Linode, Hetzner, or A2 Hosting).
  2. Select an OS—Ubuntu 22.04 LTS is the most common for WordPress.
  3. Enable a firewall (UFW) and create a non‑root user with sudo rights.
  4. Install the LAMP/LEMP stack:
    sudo apt update && sudo apt install nginx mysql-server php-fpm php-mysql php-xml php-gd php-curl
  5. Secure MySQL:
    sudo mysql_secure_installation

3.2. Backup Your Existing Site

From your shared host’s cPanel or via SSH:

# Export database
mysqldump -u USERNAME -p DB_NAME > wp-db.sql

# Compress files
tar -czf wp-files.tar.gz /home/USERNAME/public_html

3.3. Transfer Files to VPS

Use scp or rsync for a reliable transfer:

scp wp-db.sql wp-files.tar.gz user@VPS_IP:/home/username/

Or, for incremental sync:

rsync -avz -e ssh /path/to/local/wp-files.tar.gz user@VPS_IP:/home/username/

3.4. Restore the Database on VPS

# Log into MySQL
mysql -u root -p

# Create database and user
CREATE DATABASE wp_new;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'StrongPassword!';
GRANT ALL PRIVILEGES ON wp_new.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

# Import
mysql -u wp_user -p wp_new < wp-db.sql

3.5. Extract Files & Adjust Permissions

tar -xzf wp-files.tar.gz -C /var/www/html/
cd /var/www/html/
sudo chown -R www-data:www-data *
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;

3.6. Update wp-config.php

Edit the file to match the new database credentials and set the proper WP_HOME and WP_SITEURL if you are using a sub‑domain for testing.

define('DB_NAME', 'wp_new');
define('DB_USER', 'wp_user');
define('DB_PASSWORD', 'StrongPassword!');
define('DB_HOST', 'localhost');

3.7. Configure Nginx (or Apache)

Example Nginx server block for example.com:

server {
    listen 80;
    server_name example.com www.example.com;
    root /var/www/html;

    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|svg|ico)$ {
        expires max;
        log_not_found off;
    }
}

3.8. Test on the Temporary Sub‑Domain

Point a local /etc/hosts entry (or create a DNS A‑record like test.example.com) to the VPS IP, then browse to the site. Verify:

4. Switching DNS to Point to Your VPS

Sponsored

Once the test site is confirmed, update the primary A‑record for example.com and www.example.com in your domain registrar’s DNS panel to the VPS IP address. TTL (Time‑to‑Live) should be set to 300 seconds for a quick transition.

Propagation typically finishes within 15‑30 minutes, but keep the old shared host active for 24‑48 hours as a safety net.

5. Post‑Migration Optimisations

6. Comparison: Shared Hosting vs. VPS (2026)

Feature Shared Hosting VPS Hosting
CPU Allocation Shared among many users (burstable) Dedicated cores (e.g., 2 vCPU)
RAM Typically 512 MB – 2 GB total pool 2 GB – 16 GB dedicated
Disk Type HDD or limited SSD, shared I/O NVMe SSD, isolated I/O
Root Access No Full root/Sudo
Scalability Limited; need to upgrade plan Vertical scaling in minutes
Security Basic shared firewall Custom firewall, fail2ban, SELinux
Cost (average per month) $3 – $10 $15 – $80

Verdict & Recommendation

If your WordPress site receives more than 10 000 monthly visitors, runs resource‑intensive plugins (e.g., page builders, e‑commerce), or you simply require full control over the server stack, moving to a VPS is the logical next step. The migration process described above can be completed in 1‑2 hours with minimal downtime when you follow the checklist and test on a sub‑domain before flipping DNS.

Recommended VPS providers for 2026:

Start with a modest 2 vCPU / 4 GB RAM plan, monitor resource usage with htop or a monitoring service, and scale up as needed. Your site will become faster, more secure, and ready for the traffic surges of 2026 and beyond.