
Moving WordPress from shared hosting to VPS can feel scary. But with the right steps, anyone can do it. This guide shows you exactly how to move your WordPress site to a VPS. We will cover every step. From backup to going live. Let’s get started.
Quick Answer: How to Move WordPress from Shared Hosting to VPS
Here is the short version of moving WordPress from shared hosting to VPS:
- Back up your WordPress files and database.
- Set up a VPS with a web stack (Nginx or Apache, PHP, MySQL).
- Transfer your files using SCP, rsync, or a migration plugin.
- Import your database to the new VPS.
- Update wp-config.php with new database details.
- Test your site using a hosts file trick.
- Point your domain to the VPS IP address.
- Install SSL and set up security.
The whole process takes 1 to 3 hours for most small websites.
Why Move WordPress from Shared Hosting to VPS? Signs It’s Time to Upgrade
Shared hosting is fine for small blogs. But as your site grows, you may need more power. Moving WordPress from shared hosting to VPS gives you better speed, more control, and room to grow.
Performance and Speed Benefits of VPS Hosting
A VPS gives your site its own space. You do not share CPU or RAM with others. This means faster page loads. Google likes fast sites. Your visitors will stay longer.
When Shared Hosting Is Holding Your WordPress Site Back
You may notice slow load times. Your site might crash during traffic spikes. Some plugins may not work. These are signs that shared hosting can no longer handle your needs.
Shared Hosting vs VPS: Quick Comparison for Small Websites
| Feature | Shared Hosting | VPS Hosting |
|---|---|---|
| Speed | Slow during peak times | Consistent and fast |
| Control | Limited | Full root access |
| Scalability | Very limited | Easy to upgrade |
| Security | Basic | Custom firewalls and rules |
| Cost | $3-$10/month | $5-$20/month |
Pre-Migration Checklist Before Moving WordPress to VPS
Before moving WordPress from shared hosting to VPS, you need to prepare. Skip this step and you risk losing data.
Back Up Your WordPress Files and Database
Use your hosting control panel or a plugin to create a full backup. Save both files and the database. Store the backup on your computer or cloud storage.
Audit Your Current WordPress Setup (Plugins, Themes, PHP Version)
Make a list of your active plugins and theme. Check your PHP version. You will need this info on the new VPS. Some plugins need specific PHP versions to work.
Choose a VPS Provider and Control Panel (CloudPanel, Virtualmin, etc.)
Pick a VPS provider that fits your budget. Popular choices include DigitalOcean, Vultr, and Hetzner. For the control panel, CloudPanel is great for beginners. Virtualmin works well too. Make sure your panel supports WordPress.
Lower DNS TTL Before Migration
Go to your DNS settings. Lower the TTL (Time to Live) to 300 seconds. Do this 24 hours before you move. This helps DNS changes spread faster when you switch.
Choose Your Migration Method: Manual vs Plugin-Based
When moving WordPress from shared hosting to VPS, you have two main options. Manual migration gives you full control. Plugin migration is easier for beginners.
When to Use Manual Migration (SSH/rsync)
Choose manual migration if your site is large. Or if you want to learn how things work. You will use SSH and rsync commands. This method is faster for big sites.
When to Use a Migration Plugin (Duplicator, All-in-One WP Migration)
Use a plugin if you are new to server management. Plugins like Duplicator handle most of the work. They are best for small to medium sites under 500MB.
Step-by-Step: Moving WordPress from Shared Hosting to VPS Manually
This is the core of moving WordPress from shared hosting to VPS. Follow each step carefully.
Step 1: Provision Your VPS and Install the Web Stack (Nginx/Apache, PHP, MySQL)
Sign up for a VPS. Choose Ubuntu 22.04 or 24.04 as your OS. Connect via SSH. Then install your web stack. For Nginx, run these commands:
- sudo apt update && sudo apt upgrade -y
- sudo apt install nginx php-fpm php-mysql mysql-server -y
For Apache, replace nginx with apache2 in the command. Start all services and enable them on boot.
Step 2: Create a New WordPress Site on Your VPS
Create a new MySQL database and user for WordPress. Use this command:
- mysql -u root -e “CREATE DATABASE wordpress; CREATE USER ‘wpuser’@’localhost’ IDENTIFIED BY ‘strongpassword’; GRANT ALL ON wordpress.* TO ‘wpuser’@’localhost’;”
Then download WordPress from wordpress.org. Extract it to your web root folder, like /var/www/yoursite.com/.
Step 3: Export Your WordPress Database from Shared Hosting
Log in to your shared hosting phpMyAdmin. Select your WordPress database. Click Export. Choose the SQL format. Click Go. Save the .sql file to your computer.
Step 4: Transfer WordPress Files to VPS via SCP or rsync
Use SCP to copy files from shared hosting to VPS. Run this command from your local machine:
- scp -r user@shared-host-ip:/home/user/public_html/* root@vps-ip:/var/www/yoursite.com/
For large sites, rsync is better. It only copies changed files. Use: rsync -avz user@shared-host-ip:/home/user/public_html/ root@vps-ip:/var/www/yoursite.com/
Step 5: Import the Database on Your VPS
Upload your .sql file to the VPS. Then import it using this command:
- mysql -u wpuser -p wordpress < backup.sql
Enter the database password when asked. Wait for the import to finish.
Step 6: Update wp-config.php with New Database Credentials
Open the wp-config.php file in your WordPress folder. Change these values:
- DB_NAME — your new database name
- DB_USER — your new database user
- DB_PASSWORD — your new database password
- DB_HOST — usually localhost
Save the file after making changes.
Step 7: Set Correct File Permissions on VPS
Wrong permissions can break your site. Run these commands:
- sudo chown -R www-data:www-data /var/www/yoursite.com/
- sudo find /var/www/yoursite.com/ -type d -exec chmod 755 {} \;
- sudo find /var/www/yoursite.com/ -type f -exec chmod 644 {} \;
This keeps your files safe and lets WordPress work properly.
Alternative: How to Migrate WordPress to VPS Using a Plugin
If manual steps feel too hard, plugins can help with moving WordPress from shared hosting to VPS.
Using Duplicator for WordPress VPS Migration
Install Duplicator on your old site. Create a package. It gives you an installer.php and an archive file. Upload both to your VPS. Visit yourdomain.com/installer.php in a browser. Follow the setup wizard. Done.
Using All-in-One WP Migration for Simple Transfers
Install this plugin on both sites. Export from the old site. Import on the new VPS site. Note: the free version has a 512MB limit. Good for small blogs.
Using Migrate Guru for Large WordPress Sites
Migrate Guru handles sites up to 200GB. Install it on both sites. Enter your VPS site URL and a key. The plugin copies everything for you. No file size limits.
Test Your WordPress Site on VPS Before Going Live
Always test before pointing your domain. This avoids surprises when moving WordPress from shared hosting to VPS.
How to Use a Hosts File Override for Testing
Edit the hosts file on your computer. On Windows, it is at C:\Windows\System32\drivers\etc\hosts. On Mac or Linux, it is at /etc/hosts. Add this line:
VPS_IP yourdomain.com
This makes your computer send traffic to the VPS. Other visitors still see the old site.
Verify Permalinks, Images, and Forms Work Correctly
Click through every page. Check that images load. Test your contact form. Make sure permalinks work. If permalinks break, go to Settings > Permalinks in WordPress and click Save.
DNS Cutover: Pointing Your Domain to the New VPS
This is the final switch when moving WordPress from shared hosting to VPS.
Update A Records to Your VPS IP Address
Go to your domain registrar or DNS provider. Find the A record for your domain. Change the IP address to your VPS IP. Save the changes.
How Long Does DNS Propagation Take?
DNS changes can take 1 to 48 hours. Most of the time, it happens in under 4 hours. You lowered the TTL earlier, so it should be fast.
Keep Your Old Shared Hosting Active as a Backup
Do not cancel your shared hosting right away. Keep it for at least one week. If something goes wrong, you can switch back fast.
Post-Migration Tasks After Moving WordPress to VPS
After moving WordPress from shared hosting to VPS, you need to secure and optimize your site.
Install and Configure SSL Certificate (Let’s Encrypt)
Use Certbot to get a free SSL certificate. Run: sudo apt install certbot python3-certbot-nginx -y. Then run: sudo certbot –nginx -d yourdomain.com. Follow the prompts. Your site will now use HTTPS.
Enable Caching and Optimize Performance on VPS
Install a caching plugin like WP Super Cache or W3 Total Cache. On the server level, enable Nginx FastCGI caching or use Redis. This makes your site much faster.
Set Up Automated Backups on Your New VPS
Use a tool like UpdraftPlus for WordPress backups. Or set up a cron job on the VPS to back up files and database daily. Store backups off-site, like on Amazon S3 or Google Drive.
Harden WordPress Security on VPS (Firewall, Fail2Ban, SSH Keys)
Set up a firewall using UFW. Allow only ports 22, 80, and 443. Install Fail2Ban to block bad login attempts. Use SSH keys instead of passwords. Disable root SSH login for extra safety.
Troubleshooting Common Issues When Moving WordPress to VPS
Problems can happen when moving WordPress from shared hosting to VPS. Here are common fixes.
Database Connection Errors After Migration
Check wp-config.php. Make sure the database name, user, and password are correct. Also check that the database user has proper permissions.
Broken Images and Internal Links
This often means file permissions are wrong. Run the chmod commands from Step 7. Also check that the site URL in the database matches your domain.
White Screen of Death (WSOD) on VPS
A white screen usually means a PHP error. Check the error log at /var/log/nginx/error.log or /var/log/apache2/error.log. Common causes: missing PHP extensions or memory limits.
PHP Version or Extension Compatibility Issues
Some plugins need specific PHP extensions. Install them with: sudo apt install php-gd php-curl php-xml php-mbstring -y. Restart PHP-FPM after installing.
SSL Certificate Not Working After Migration
Make sure port 443 is open in your firewall. Re-run Certbot. Check that your Nginx or Apache config has the SSL settings. Restart the web server.
Rollback Plan: How to Revert to Shared Hosting if VPS Migration Fails
If things go wrong, you can go back. Remove the A record change at your DNS provider. Point it back to the shared hosting IP. Since you kept shared hosting active, your old site will come back within hours. This is why keeping the old hosting is important when moving WordPress from shared hosting to VPS.
FAQ: Moving WordPress from Shared Hosting to VPS
How Long Does It Take to Move WordPress from Shared Hosting to VPS?
For a small site, it takes 1 to 2 hours. Larger sites may take 3 to 4 hours. DNS propagation adds up to 48 hours, but usually finishes in a few hours.
Will There Be Downtime When Moving WordPress to VPS?
If you use the hosts file trick, there is zero downtime for testing. During DNS cutover, some visitors may see the old site for a short time. Total downtime is usually under 30 minutes.
Can I Migrate WordPress to VPS Without Technical Knowledge?
Yes. Use a plugin like Duplicator or Migrate Guru. Many VPS providers also offer one-click WordPress installs. You can also hire someone to help if needed.
How Much Does a VPS Cost Compared to Shared Hosting?
Shared hosting costs $3 to $10 per month. A basic VPS costs $5 to $20 per month. The extra cost gives you much better performance and control.
Do I Need to Reinstall WordPress on VPS?
No. You are moving your existing WordPress install. You do not need a fresh install. Just transfer files and database, then update the config.
Conclusion: Next Steps After Moving WordPress from Shared Hosting to VPS
Moving WordPress from shared hosting to VPS is a smart move for growing websites. You get faster speeds, better security, and full control. Follow this guide step by step. Test before going live. Keep your old hosting as a backup. After the move, focus on security, caching, and backups. Your WordPress site will thank you with better performance and happier visitors.
