---
title: "Migrate WordPress to a new server"
url: https://phatdev.net/en/docs/sl-migrations/how-to-migrate-wordpress-site
lang: en
updated: 2026-10-20
alternate:
  vi: https://phatdev.net/docs/sl-migrations/how-to-migrate-wordpress-site
markdown: https://phatdev.net/en/docs/sl-migrations/how-to-migrate-wordpress-site.md
---

# Migrate WordPress to a new server

Part of the doc set: [SL Migrations](https://phatdev.net/en/docs/sl-migrations.md)

> The workflow for moving a whole site to a new host with a DNS cutover.

For moving an entire site from host A to host B (same domain or a new domain).

## Pre-flight check

On the source host (A):
- PHP version and the list of plugins in use
- Database and file sizes
- Files outside `wp-content` (custom root files)
- Email accounts, cron jobs, SSL certificate

On the destination host (B):
- PHP version **>=** the source (downgrading easily causes errors)
- MySQL version **>=** the source
- Free disk >= 2× the site size
- SSL certificate already issued (if you need HTTPS)

## Step 1: Create a full backup on host A

Exclude folders you do not need:
- `wp-content/cache/`
- `wp-content/backups-slm/` (itself)
- Large log files

Wait for the build to finish → download it to your computer or upload it to cloud storage so you can move it to host B.

## Step 2: Set up host B

- Create an empty database and a user with full privileges
- Create a web root for the domain (if the host requires it)
- Configure SSL if needed

How you create a database depends on the hosting:
- **cPanel**: Database → MySQL Databases → Create New Database
- **Plesk**: Databases → Add Database
- **Managed WP hosting**: usually has its own interface

## Step 3: Upload and run the installer

Upload `installer.php` + the archive to host B's web root.

Open `https://[IP-host-B]/installer.php` (use the IP because DNS does not point there yet).

Or use the `hosts` file on your local machine to map the domain temporarily:
```
[IP-host-B]  example.com
```

Then open `https://example.com/installer.php` as usual.

## Step 4: Verify the site

- Log in to wp-admin → check Posts/Pages
- Test the contact form, checkout and sign-up
- Check that images are not broken
- Verify that cron is running

## Step 5: DNS cutover

Once everything checks out, change the DNS A record to host B's IP. Lower the TTL to 300s 24 hours before the cutover.

While DNS propagates:
- Put host A in read-only mode (warn users not to make updates)
- Or redirect host A to host B if you can

## Step 6: Clean up host A

Wait 7-14 days after DNS propagation completes → delete host A once you are sure you will not need to roll back.

## See also

- [Quick Start](https://phatdev.net/en/docs/sl-migrations/quick-start)
- [Classic Install](https://phatdev.net/en/docs/sl-migrations/classic-install)
