PR
SERVER

A Complete Guide to WordPress Server Migration: A Professional’s Manual Migration from a Shared Server to a VPS [Summary Version]

If you’re a beginner, you’ll likely use plugins like All-in-One WP Migration or Duplicator to migrate your WordPress site. In this article, however, I’ll deliberately focus on manual procedures designed for professionals who prioritize reproducibility and ease of troubleshooting. When migrating from a shared server to a VPS, you’ll need to ensure SSH access to both the source and destination servers, migrate the database and files separately, verify the new environment via the hosts file, and then switch the DNS records.

As an overview, this article coverswp db export、rsync、wp-config.php outlines the overall process of manual migration, including wp db create、wp db import . The destination is assumed to be a VPS, and the guide is written to be applicable to general LAMP or LEMP configurations, including KUSANAGI. Please note that email migration is not covered in this article. We will explain MX, SPF, DKIM, DMARC, and SMTP in detail in a separate article.

  • You can learn the manual migration workflow for professionals, rather than relying on plugins.
  • You can review the preparation checklist for moving from a shared server to a VPS.
  • You can review the preparation checklist for moving from a shared server to a VPS.You can understand the workflow for SSH configuration, DB export, rsync,wp-config.php configuration, database creation, database import, hosts file verification, and DNS switchover.
  • You’ll learn the criteria for considering Xserver VPS as a migration destination.
  • You’ll learn where speed improvements are most likely to occur and why PageSpeed scores don’t always change significantly.

Conclusion First

This procedure is not intended as the quickest route for beginners. It is suited for those who prefer to proceed carefully, checking the status via logs and commands rather than relying on plugins. A key feature is that it makes it easy to track what was moved where and where problems occurred, and to easily reproduce the same migration multiple times.

If you’re performing a manual WordPress server migration, following this sequence—exporting the database from the old server, receiving the files on the new server, configuring the destination’s `wp-config.php`, verifying via `hosts`, and then switching the DNS—will help you avoid major issues. This order remains the same even when migrating while keeping the domain unchanged.

  • Step 1: Verify SSH connections between the source and destination servers, and set up the destination environment on the VPS
  • Step 2: On the source server, wp db export to back up the SQL database
  • Step 3: From the destination VPS, rsync to retrieve the WordPress files
  • Step 4: On the destination, wp-config.php , and if necessary, wp db create and then wp db import as needed
  • Step 5: Verify the new server in the hosts file
  • Step 6: Switch DNS records, then monitor SSL and the site after going live

A common misconception is thatwp export people often assume that using [WordPress Export] will migrate the entire WordPress site, but this feature only exports posts and pages as XML. Since server migration requires moving the entire database, we will use wp db export here.

Pre-Migration Preparation Checklist

Before proceeding with the steps, please ensure you have the following items ready. If you proceed while these details remain unclear, you’re more likely to get stuck due to insufficient preparation than during the migration process itself.

  • SSH access is available on both the source shared server and the destination VPS
  • A web server, PHP, database, and document root are set up on the destination VPS
  • A full backup of the source server has been taken
  • Choose a time when there is no heavy traffic for article updates, form submissions, or user registrations
  • Check for differences in major PHP versions and the availability of required extensions
  • Plan on reissuing or reconfiguring the custom SSL certificate after the DNS switch
  • If possible, shorten the TTL of DNS records by the day before
  • Do not cancel the old server immediately after the switch; keep it active for at least 48 to 72 hours

The difference between `wp export` and `wp db export`

wp export “wp-export” and “wp-db-export” are commands that call WordPress’s standard export functions via the CLI, outputting posts, pages, custom post types, taxonomies, and more as XML. While these can be used for content migration, they are not suitable for transferring everything—including option tables, plugin settings, user information, and serialized data—in its entirety.

If you’re moving WordPress from a shared server to a VPS as-is, what you need is wp db export . Since this exports the entire database as SQL,wp db import it can be used in conjunction with the file-based export. The file-based export rsync, and the database side is wp db export .

Preparing to Use WP-CLI on Lolipop

On Lolipop, unlike with a VPS, wp . Therefore,wp-cli.phar you need to place it in your home directory and prepare to run it by explicitly specifying the PHP binary. In my tests, /usr/local/php/8.4/bin/php it worked, but this path may vary depending on your plan or PHP version.

mkdir -p ~/bin
curl -fL -o ~/bin/wp-cli.phar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod  x ~/bin/wp-cli.phar
/usr/local/php/8.4/bin/php ~/bin/wp-cli.phar --info

If typing the long command every time is a hassle, creating a wrapper will make things easier.

cat > ~/bin/wp <<'EOF'
#!/bin/sh
exec /usr/local/php/8.4/bin/php "$HOME/bin/wp-cli.phar" "$@"
EOF
chmod  x ~/bin/wp
export PATH="$HOME/bin:$PATH"
wp --info

If you don’t create a wrapper, use the command in this article: wp in this article /usr/local/php/8.4/bin/php ~/bin/wp-cli.phar in this article. If you are migrating from Lolipop, completing these preparations first will make the subsequent steps much easier.

Overall Flow of WordPress Server Migration

The overall process is as follows. The key is to complete verification of the new environment before switching to the live site.

旧サーバー
  ├─ SSH接続確認
  ├─ wp db export でSQL退避
  └─ 読み出し元として維持

移行先VPS
  ├─ 初期設定とサイト受け皿作成
  ├─ rsync でファイルを取得
  ├─ wp-config.php を設定
  ├─ 必要に応じて wp db create
  └─ wp db import でDB復元

手元PC
  ├─ hosts で新サーバーを強制参照
  └─ フロント、管理画面、フォーム、画像を確認

公開切替
  ├─ DNSレコード変更
  ├─ SSL確認
  └─ ログとエラー監視
StepsMain TasksPurpose
Preliminary PreparationVerify SSH, initialize VPS, take backupEnsure data can be restored
Data Migrationwp db export Export SQLSafely Transfer the Database
File Transferrsync Copy the entire WordPress installationMove themes, plugins, and uploads
Restorewp-config.php Settings,wp db create、wp db importLaunch WordPress on the destination
Pre-checkVerify locally via hostsResolve issues before changing DNS
DeploymentUpdate DNS records, verify SSL, and monitorComplete the production switchover

WordPress Server Migration Procedure

Step 1: Verify SSH Connection and Initial Setup of the Destination VPS

The first step is to ensure you can establish a stable SSH connection to both the source and destination servers. Rather than entering the IP address and port number every time,~/.ssh/config it is safer to set up an alias.

Host wp-old
  HostName old.example.jp
  User olduser
  Port 10022
  IdentityFile ~/.ssh/id_ed25519

Host wp-new
  HostName 203.0.113.10
  User admin
  Port 22
  IdentityFile ~/.ssh/id_ed25519
ssh wp-old
ssh wp-new

On the destination VPS, prepare at least the following infrastructure in advance. The same approach applies when using KUSANAGI: complete provisioning and create the document root before importing files and the database.

  • OS Updates and Public Key Authentication Verification
  • Prepare Nginx or Apache, PHP, and MariaDB or MySQL
  • Create the document root for the target domain
  • Finalize the database name, database user, permissions, and connection details

When using KUSANAGI’s provisioning, the database and wp-config.php may be set up automatically. However, in standard LAMP or LEMP environments, we will proceed on the assumption that wp-config.php .

You don’t need to complete the SSL setup at this stage. Since the requirements for certificate issuance may not yet be met before the DNS switch, it’s easier to proceed by prioritizing getting WordPress up and running without issues first.

Step 2: Export the Database from the Source

Next, export the database from the WordPress directory on the source server. Simply transferring the files will not restore post content, settings, or plugin configurations. Be sure to obtain the SQL file first.

ssh wp-old
cd /home/olduser/public_html
wp db export ~/backup/site-$(date  %F).sql --add-drop-table

In environments like Lolipop where standard wp command, replace the commands in this step /usr/local/php/8.4/bin/php ~/bin/wp-cli.phar db export ~/backup/site-$(date %F).sql --add-drop-table as shown below.

If possible, for added peace of mind, keep a separate backup using your hosting provider’s backup feature in addition to the exported SQL file. For sites that receive comments or order data right before the switch, plan in advance to minimize downtime.

Step 3: Copy files from the destination VPS using rsync

For file migration, a configuration where the destination VPS rsync . This approach is easier to manage. The advantages are that it is easy to restart if the transfer stops midway, and it only retrieves the differences. This procedure assumes that the destination can connect to the source via SSH.

ssh wp-new
rsync -avz --progress -e 'ssh -p 10022' 
  --exclude 'wp-content/cache/' 
  --exclude '.git/' 
  [email protected]:/home/olduser/public_html/ 
  /home/kusanagi/example.com/DocumentRoot/
  • For the first execution, --delete .
  • It is fine to exclude cache directories and temporary files.
  • wp-config.php Overwriting the entire directory may cause the destination’s database connection information to be restored.
  • Be careful not to mistype the trailing slash in the document root, as this will shift the file placement by one level.

If SSH between servers is difficult due to shared hosting restrictions, you can also use your local PC as a relay rsync . For the sake of clarity in this article, we will first assume a server-to-server transfer.

Step 4: Configure wp-config.php on the destination server, create the database, and then import

Once all the files are ready, first verify the wp-config.php . If it has been provisioned by KUSANAGI, the database and wp-config.php is often already created, so verify that the values are correct before proceeding with the import. In standard LAMP or LEMP environments, update the file with the connection details for the destination database, and if necessary, wp db create , and then wp db import .

cd /var/www/html
vi wp-config.php
define( 'DB_NAME', 'example_db' );
define( 'DB_USER', 'example_user' );
define( 'DB_PASSWORD', 'example_password' );
define( 'DB_HOST', 'localhost' );

These four items—the database name, database user, database password, and database host—should match those of the destination. You must create the database user and grant permissions in advance on the MySQL or MariaDB side.

ssh wp-new
cd /home/kusanagi/example.com/DocumentRoot
wp db create
wp db import /home/admin/backup/site-2026-03-29.sql
wp option get home
wp option get siteurl
wp rewrite flush --hard
wp cache flush

If the database has already been created, wp db create , you may skip this step. The order is as follows:wp-config.php configure the connection settings, and if necessary, wp db create , and then wp db import .

Here, you should verify the following: the database connection, PHP extensions, permissions, upload directory, cron, and the status of the cache plugin. If the web server is changing—for example, from Apache to Nginx—the settings in.htaccess the existing configuration may not work as-is.

If you are changing the domain, insert the following replacements. Conversely, if migrating with the same domain, you usually do not need to perform this step.

wp search-replace 'https://old.example.com' 'https://new.example.com' --skip-columns=guid

Step 5: Verify local operation using the hosts file

Before switching the DNS, point the domain to the new server’s IP address in your local computer’s hosts file and verify the display. If you skip this step, you’re likely to miss issues such as the homepage loading correctly but the admin panel being broken, or forms failing to submit, after going live.

203.0.113.10 example.com www.example.com
  • Homepage and Major Subpages
  • Logging into the admin panel
  • Accessing images and downloadable files
  • Contact forms and payment flow
  • Check for plugin errors
  • Mixed content and redirect loops after switching to HTTPS

Checking the hosts file is the last safety measure you can take before going live. While the editing methods differ between Mac and Windows, for the overview version, it’s sufficient to simply keep in mind the principle of “checking before DNS.”

Step 6: Change DNS Records and Monitor After Going Live

Once functionality testing is complete, finally point the DNS records to the new server. The key here is to distinguish between changing the entire nameserver setup and changing only the A or AAAA records. If you’re simply moving from a shared server to a VPS, you can usually proceed by switching only the relevant records.

  • Change the A or AAAA records to the new server’s IP address
  • If using Cloudflare, double-check proxy settings and SSL mode
  • Issue or reconfigure the SSL certificate after DNS propagation
  • Clear browser and server caches
  • Check access logs, PHP logs, and web server logs
  • Leave the old server up for a few days so you can revert the DNS if necessary

It’s safer to handle email separately at this stage. Start by switching only the web services, and follow the steps in a separate article to handle email separately—this will make verification easier.

Don’t judge the cost difference between shared hosting and VPS based on monthly fees alone

When considering a WordPress server migration, monthly fees are often the primary point of comparison, but in practice, operational time is also a cost factor. If you simply want to host a single site stably, shared hosting is often more cost-effective overall; however, when you factor in managing multiple sites or automation, VPS tends to become the more cost-effective option.

Comparison CriteriaShared HostingVPS
Initial SetupControl panel-based and lightweightRequires configuration of OS, web server, database, and permissions
Operational effortLowHigh
EmailOften includedOften requires a separate service design
FlexibilityUsed within the scope of what is providedHigh. You can determine the configuration yourself
Integration of multiple sitesProne to hitting limitationsEasy to consolidate
Ideal forSingle site, low update frequency, want to simplify operationsMultiple sites, automation, speed optimization, and learning

In other words, when deciding whether to choose a VPS for a WordPress server migration, it’s easier to make a decision if you view it not simply as a way to reduce server costs, but as a means to gain flexibility and operational efficiency.

How Much Will Speed Improve After Migration?

In a 7-day test of my own site—conducted every 3 hours from March 17, 2026, to March 24, 2026—there was a significant difference in internal server response times between the shared server (XServer Standard) and XServer VPS 2GB, a likely migration candidate.

MetricsXServer StandardXServer VPS 2GB
External TTFB 7-Day Average0.185 seconds0.130 seconds
Internal TTFB 7-day average0.510 seconds0.058 seconds
WP eval 7-day average1.738 seconds0.816 seconds
REST API 7-day average0.025 seconds0.036 seconds

Internal TTFB has decreased from approximately 0.510 seconds to 0.058 seconds, significantly increasing the headroom for the WordPress runtime. This difference is particularly noticeable in the user experience when using the admin panel, non-cached pages, and batch processing.

On the other hand, PageSpeed Insights scores do not necessarily improve dramatically just from a server migration. Averaging the same 7 days of logs, the score difference between mobile and desktop was as follows:

MetricsXServer StandardXServer VPS 2GB
PSI Mobile Average Score96.795.0
PSI Mobile Average LCP2587 ms2547 ms
PSI Desktop Average Score99.299.5
PSI Desktop Average LCP732 ms733ms

What this tells us is that moving to a VPS tends to stabilize the backend, but overall PageSpeed is heavily influenced by the theme, images, JavaScript, and CDN settings. While migrating your WordPress server is worthwhile, you should evaluate speed improvements by considering TTFB and the actual user experience.

Is Xserver VPS a viable migration option?

To put it simply, Xserver VPS is definitely worth considering as a destination for your WordPress migration. Although it wasn’t the fastest in this 7-day test, with an external TTFB of 0.130 seconds, an internal TTFB of 0.058 seconds, and a WP eval time of 0.816 seconds, it clearly outperformed the shared Xserver Standard plan.

  • It’s an easy-to-understand option for those looking to upgrade from a shared server to a VPS within the same service family.
  • It’s also a good fit for those looking to move toward KUSANAGI, custom Nginx configurations, or WP-CLI operations.
  • However, the value of a VPS isn’t determined by performance alone. It’s also important to consider whether you can maintain daily operations without difficulty.

In other words, rather than deciding solely because it’s “Xserver VPS,” it’s easier to make a choice by assessing whether the limitations of a shared server are a bottleneck and whether you can comfortably manage SSH and Linux operations.

If you’re considering Xserver VPS, you may be offered a discount on your first-month fee depending on the campaign period. To check the latest terms, please also check the link in the banner below.

エックスサーバー VPS

Common Pitfalls During Migration

  • Confusing `wp-export` with `wp-db-export`. An XML file alone is not sufficient for migrating the entire site.
  • Using the wrong destination path for rsync. Directories may end up one level off.
  • Carelessly overwriting `wp-config.php`. This may cause the database connection information and keys for the destination server to be overwritten.
  • Skipping hosts file verification and switching DNS first. This makes post-launch verification difficult.
  • Migrating email all at once on the same day. If you modify both the website and email at the same time, it becomes difficult to isolate issues.
  • Canceling the old server immediately. This makes it difficult to roll back.

Frequently Asked Questions

Can I migrate my WordPress server while keeping the domain the same?

Yes. In practice, it’s easiest to keep the domain as-is, set up the destination VPS first, verify the new environment via the hosts file, and then switch only the DNS records. Since the domain remains unchanged, URL replacement is often unnecessary.

Which is better: manual migration or plugin migration?

If you’re a beginner moving your site just once, I think a plugin-based migration is easier to tackle first. On the other hand, if you’re moving from a shared server to a VPS and plan to continue managing it going forward, documenting the process using SSH, rsync, and WP-CLI ensures higher reproducibility and makes troubleshooting easier. This article is an overview designed for such cases.

How much does migration cost?

If you handle the migration yourself, the main additional costs are the VPS subscription and your time. Using a migration service reduces the workload, but the cost varies significantly depending on the site’s size, whether it has email functionality, and whether it includes membership or e-commerce features. Beyond cost, it’s also important to ensure the site is in a state where you can manage it yourself after the migration.

Can downtime be reduced to zero?

While achieving absolutely zero downtime is difficult, it can be minimized significantly. If you verify the hosts file beforehand, set a short TTL, and keep the old server active for a while after the DNS switch, you can often complete the migration with virtually no perceptible downtime.

Summary

If you want to safely migrate your WordPress site manually, the core of the process is simple. On the source server wp db export, and on the destination server wp-config.php , and wp db create, followed by wp db import, and finally, verifying the hosts file before going live.

  • Set up SSH, backups, and a VPS destination before migration
  • Migrate the database and files separately,wp-config.php import after verifying the database creation procedure
  • Verify operation via hosts before switching DNS
  • Treat email as a separate process and keep the old server up for a few days

If you want to first determine whether a VPS is suitable for your needs, reading "What Is a VPS? A Complete Guide to the Differences from Shared Hosting" will help you make an informed decision. If your migration involves a domain change, "How to Change the URL of a WordPress Site Using WP-CLI" will also be helpful.

Comment

Copied title and URL