---
title: "Migration WordPress sang server mới"
url: https://phatdev.net/docs/sl-migrations/how-to-migrate-wordpress-site
lang: vi
updated: 2026-10-17
alternate:
  en: https://phatdev.net/en/docs/sl-migrations/how-to-migrate-wordpress-site
markdown: https://phatdev.net/docs/sl-migrations/how-to-migrate-wordpress-site.md
---

# Migration WordPress sang server mới

Thuộc bộ tài liệu: [SL Migrations](https://phatdev.net/docs/sl-migrations.md)

> Workflow chuyển toàn bộ site sang host mới với DNS cutover.

Khi chuyển toàn bộ site từ host A sang host B (cùng domain hoặc đổi domain).

## Pre-flight check

Trên host nguồn (A):
- PHP version, danh sách plugin đang dùng
- Kích thước database và file
- File ngoài `wp-content` (root files custom)
- Email accounts, cron jobs, SSL cert

Trên host đích (B):
- PHP version **>=** nguồn (downgrade dễ gây lỗi)
- MySQL version **>=** nguồn
- Disk free >= 2× kích thước site
- SSL cert đã issue (nếu cần HTTPS)

## Bước 1: Tạo backup full trên host A

Loại trừ các folder không cần:
- `wp-content/cache/`
- `wp-content/backups-slm/` (chính nó)
- Log files lớn

Đợi build xong → tải về local hoặc upload sang storage cloud để chuyển sang host B.

## Bước 2: Setup host B

- Tạo database trống và user có quyền đầy đủ
- Tạo web root cho domain (nếu host yêu cầu)
- Cấu hình SSL nếu cần

Cách tạo database tùy hosting:
- **cPanel**: Database → MySQL Databases → Create New Database
- **Plesk**: Databases → Add Database
- **Managed WP hosting**: thường có giao diện riêng

## Bước 3: Upload và chạy installer

Upload `installer.php` + archive lên web root host B.

Truy cập `https://[IP-host-B]/installer.php` (dùng IP vì DNS chưa point sang).

Hoặc dùng file `hosts` trên máy local để map domain tạm thời:
```
[IP-host-B]  example.com
```

Sau đó truy cập `https://example.com/installer.php` bình thường.

## Bước 4: Verify site

- Đăng nhập wp-admin → kiểm tra Posts/Pages
- Test form contact, checkout, đăng ký
- Kiểm tra hình ảnh không bị broken
- Verify cron đang chạy

## Bước 5: DNS cutover

Sau khi verify OK, đổi DNS A record sang IP host B. TTL nên hạ xuống 300s trước cutover 24h.

Trong thời gian DNS propagate:
- Set host A vào read-only (cảnh báo user không update)
- Hoặc redirect host A sang host B nếu có thể

## Bước 6: Cleanup host A

Đợi 7-14 ngày sau DNS propagate hoàn tất → xóa host A khi chắc chắn không cần rollback.

## Tham khảo

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