Skip to content

Migrating WordPress from shared hosting to a VPS

By Onehost Team1 min read

Outgrown shared hosting? Moving WordPress to a VPS gives you your own server and full control. Here's a safe migration plan.

1. Prepare the VPS

Set up a LEMP or LAMP stack (Nginx/Apache, MariaDB, PHP) on your new VPS and create an empty database for the site.

2. Back up the old site

  • Export the database (via phpMyAdmin or mysqldump).
  • Download all files, especially wp-content/.

3. Move the data

scp -r wordpress-files/ deploy@new-vps:/var/www/site
mysql site < database.sql

4. Update wp-config.php

Point it at the new database name, user and password.

5. Test before switching DNS

Edit your local hosts file to preview the site on the new server. Once it works, lower your domain's DNS TTL, then update the A record to the new VPS IP.

6. Finish

Add HTTPS with Certbot and keep the old host live for a day or two until DNS fully propagates. Done right, visitors never notice the move.

Put it into practice

Let our engineers set up, patch and monitor your web server.

Managed Linux VPS