Docs / Migration Guides / How to Migrate a WordPress Site to a New Server

How to Migrate a WordPress Site to a New Server

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 27 views · 2 min read

Overview

Moving a WordPress site to a new Breeze requires transferring files, the database, and updating configuration. This guide walks through a clean migration with minimal downtime.

Step 1: Back Up the WordPress Files

On the source server, compress the entire WordPress directory:

tar czf wp-backup.tar.gz -C /var/www/html .

Step 2: Export the Database

mysqldump -u wpuser -p wordpress_db > wp-database.sql

Step 3: Transfer to the New Breeze

scp wp-backup.tar.gz root@new-breeze-ip:/var/www/html/
scp wp-database.sql root@new-breeze-ip:/tmp/

Step 4: Restore Files

cd /var/www/html
tar xzf wp-backup.tar.gz
chown -R www-data:www-data /var/www/html

Step 5: Create and Import Database

mysql -u root -p -e "CREATE DATABASE wordpress_db;"
mysql -u root -p -e "CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'strong_password';"
mysql -u root -p -e "GRANT ALL ON wordpress_db.* TO 'wpuser'@'localhost';"
mysql -u root -p wordpress_db < /tmp/wp-database.sql

Step 6: Update wp-config.php

Edit /var/www/html/wp-config.php and update database credentials if they changed:

define('DB_NAME', 'wordpress_db');
define('DB_USER', 'wpuser');
define('DB_PASSWORD', 'strong_password');
define('DB_HOST', 'localhost');

Step 7: Update URLs if Domain Changed

If the domain is different, run a search-replace using WP-CLI:

wp search-replace 'https://olddomain.com' 'https://newdomain.com' --all-tables --allow-root

Final Steps

  • Update DNS to point to the new Breeze
  • Install an SSL certificate with Certbot
  • Test all pages, plugins, and the admin dashboard
  • Flush permalinks under Settings > Permalinks

Was this article helpful?