How to Migrate WordPress from Shared Hosting to a VPS: Step-by-Step

Shared hosting is a fine start, but slow neighbors, strict resource limits, and missing server controls eventually push growing sites toward a VPS. When you migrate WordPress shared hosting to VPS, you gain root access, your own PHP settings, and resources nobody else can eat. This guide moves a site in a careful order: prepare, build the VPS, move files and database, switch DNS, and verify everything before calling it done.

WordPress Migration Checklist: Before You Move Anything

Start with a checklist, not a download. Write down the live site details you will need: the domain, the hosting panel login, the database name and user, the PHP version, and every plugin that must keep working. Note custom items too: cron jobs in the panel, email accounts tied to the domain, and any DNS records beyond the main website, such as mail and verification records. Migrations fail most often on forgotten details, not on file transfers.

Also decide the target VPS size before you build. A site that ran on shared hosting usually fits a small VPS, but check current disk use and traffic first. Shared hosting versus VPS versus dedicated explains what changes with the move, and why a VPS suits sites that outgrew shared limits but do not need a whole server.

Back Up Everything Twice

Take a full backup from the shared hosting panel: files plus database. Download it to your own computer, not just to another folder on the same account. Then take a second backup with a different method, such as a migration plugin export or a manual database dump. Two backups from different methods protect against the case where one export is incomplete and you only discover it after DNS has moved.

While the backup runs, put the site into a quiet state if you can: finish pending orders, publish or save drafts, and warn editors that content edits during the move may be lost. The cleaner the cutoff, the simpler the verification later.

Build the VPS and Install WordPress

Provision the VPS, secure SSH, set up a firewall, and install the LEMP stack: Linux, Nginx, PHP, and MariaDB or MySQL. Installing WordPress on a VPS LEMP stack with Nginx, PHP, and MariaDB walks through the stack setup, and the first 10 things to do after buying a VPS covers the security baseline you should finish before the site goes live. Install the same PHP version as the old host when possible; a PHP major-version jump during migration adds a second variable to debug if something breaks.

Create an empty database and user on the VPS, and note the credentials. You will import the old database into it in the next step.

Move the Files

Download the WordPress files from shared hosting, or transfer them directly with rsync or SCP if the old host allows SSH. Upload them to the VPS document root, excluding cache folders and stale backup archives. Set ownership to the web user:

chown -R www-data:www-data /var/www/yoursite.com

Check wp-config.php on the VPS: update the database name, user, password, and host, and confirm the table prefix matches the old install. A wrong prefix makes WordPress act like a fresh install with no content, which looks alarming but is a one-line fix.

Move the Database When You Migrate WordPress Shared Hosting to VPS

Import the old database dump into the new database:

mysql -u USER -p new_db < old_db.sql

If the domain stays the same, no URL change is needed. If the domain changes, run wp-cli search-replace with the old and new domains, since it handles serialized data correctly. After import, open wp-admin on the VPS using a temporary method: edit your local hosts file to point the domain at the VPS IP, or use a temporary subdomain. Test the homepage, several posts, the admin area, and any forms before touching DNS.

VPS Migration DNS Propagation: What to Expect

Only after the VPS copy passes testing should you point DNS at the new server. Update the A record for the domain and www to the VPS IP address. To move WordPress to VPS with the least confusion, lower the DNS TTL to 300 seconds at least a day before the switch, so the change spreads faster when you make it.

Propagation is not instant for everyone. Some visitors reach the new server in minutes, others take hours, and a few stragglers take up to a day. During that window, avoid editing content on either copy, because edits on the old server will not appear on the new one. Check propagation with a public DNS checker from several locations before assuming the move is complete.

Verify Everything After Launch

Once DNS points at the VPS, run a full check:

  • Homepage, posts, pages, and category archives load without errors.
  • Forms submit and reach their destination.
  • Search works and returns results.
  • SSL certificate is valid and no mixed-content warnings appear.
  • Admin login, media uploads, and plugin settings all work.
  • PHP error log shows no new fatal errors.

Fix problems on the VPS copy directly. Do not flip DNS back and forth while debugging, since each flip restarts the propagation wait and confuses visitors and search engines.

Keep the Old Hosting Until You Are Sure

Keep the shared hosting account active for at least a week after the move. That window covers late DNS stragglers, missed email records, and any file you forgot to transfer. Only cancel once the VPS copy has served real traffic for several days with no issues. Moving panels can also be part of this journey: moving from cPanel to a free panel without downtime covers the panel side for owners who want to change control panels along with servers.

Follow this order, test before DNS moves, and keep the old host as a safety net. That is the whole method: no drama, no missing content, and a site that finally runs on resources you control.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.