Skip to main content

Migrating WordPress to a ZevsHost VDS

Migration · 12.01.2025 · 5 min read
Illustration for “Migrating WordPress to a ZevsHost VDS”

Migrating WordPress to a VDS: an order that keeps the site up

Moving from shared hosting to a VDS differs from moving between two hosting providers in one key way: a VDS has nothing set up in advance — no web server, no PHP, no database. You need to set those up before copying any files. Below are both working methods and an order of steps that does not leave the site unreachable even for a couple of minutes.

  1. Set up a LEMP or LAMP stack on the VDS (Nginx/Apache + PHP-FPM + MySQL) with the same or a newer PHP version than the old hosting.
  2. Copy the site files and take a database dump without stopping the old site.
  3. Import the database and files on the VDS, and configure a virtual host for the test domain or IP.
  4. Check the site on the VDS through the hosts file, without touching the real domain's DNS.
  5. Switch DNS only after confirming the site works correctly.

Method 1: the All-in-One WP Migration plugin

Fits sites up to 512 MB on the free plugin version — that limit on the exported archive size is set by the plugin itself.

  1. Install the All-in-One WP Migration plugin on the old site through the WordPress admin.
  2. Export the site: WP Migration → Export → File, and wait for the .wpress file to download.
  3. Install a clean WordPress on the VDS with the same version as the old site.
  4. Install the same plugin on the new site and import the file through Import.
  5. The plugin updates the site URL in the database itself — nothing needs to be changed by hand.

Method 2: manual migration with mysqldump and rsync

Fits sites of any size and gives more control over the process.

Files

rsync -avz --progress -e ssh /var/www/old-site/ root@vds-ip:/var/www/new-site/

Database

mysqldump -u user -p --single-transaction wordpress_db > wp_dump.sql
scp wp_dump.sql root@vds-ip:/root/
mysql -u user -p wordpress_db < wp_dump.sql

Replacing the domain in the database

If you are testing the site under a temporary address rather than the live domain, replace links in the database with WP-CLI, not by hand with SQL — WordPress stores serialized arrays, and a plain UPDATE breaks them.

wp search-replace 'https://old-domain.com' 'https://new-domain.com' --all-tables

Configuring wp-config.php on the new server

define('DB_NAME', 'wordpress_db');
define('DB_USER', 'wp_user');
define('DB_PASSWORD', 'new_password');
define('DB_HOST', 'localhost');

Comparing migration methods

MethodSize limitNeeds SSHControl over the process
All-in-One WP Migration (free)up to 512 MBnominimal
All-in-One WP Migration (Unlimited Extension)no limitnominimal
Manual migration (rsync + mysqldump)no limityesfull

Checking the VDS before the DNS switch

echo "YOUR_VDS_IP example.com www.example.com" | sudo tee -a /etc/hosts

Open the site in a browser — it will connect to the VDS by domain name, while real visitors keep seeing the old hosting. Check admin login, checkout (if this is a WooCommerce store), and that images load correctly from wp-content/uploads.

Common errors after migration

SymptomCause and fix
White screen with no errorA PHP extension is missing (usually gd or mysqli) — install the same environment on the VDS as on the old hosting
"Error establishing a database connection"Wrong data in wp-config.php, or MySQL listens on a socket instead of localhost — check DB_HOST
Images and styles do not loadOld domain links remain in the database — run wp search-replace again
404 on every page except the homepagePretty-URL rules are not configured in Nginx/Apache — add try_files for Nginx or enable mod_rewrite for Apache

Rollback after a failed migration

  1. Do not delete the site on the old hosting until the VDS has run for at least a full day.
  2. If the site behaves unstably after the DNS switch, restore the old A records for the domain.
  3. Fix the problem on the VDS calmly, and repeat the hosts-based check before switching again.

When this approach does not fit

Without server administration experience, setting up a LEMP stack yourself and the follow-up maintenance (PHP updates, security, backups) can cost more time than the hosting switch saves. In that case it is more sensible to order a free migration handled by ZevsHost onto a managed VDS with a ready-made panel.

Checking the result

  • Compare the number of rows in the wp_posts table on the old and new site.
  • Check that all plugins are active and do not require a license reactivation.
  • Run the site through PageSpeed Insights — a VDS is usually faster than shared hosting.
  • Set up automatic backups on the new server before switching DNS — see the article on syncing and backing up servers with rsync.
Was this article helpful?
← Back to Knowledge Base Ask Support