---
title: "Tạo gói backup mới"
url: https://phatdev.net/docs/sl-migrations/create-backup
lang: vi
updated: 2026-10-20
alternate:
  en: https://phatdev.net/en/docs/sl-migrations/create-backup
markdown: https://phatdev.net/docs/sl-migrations/create-backup.md
---

# Tạo gói backup mới

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

> Các bước tạo backup và những thành phần có thể tùy chỉnh.

## Các bước

1. **SL Migrations → Packages → Create New**
2. Đặt tên gói. Plugin tự thêm hash và timestamp vào tên file.
3. **Storage** - chọn nơi lưu archive. Mặc định là Default Local Storage. Có thể thêm storage từ xa qua SFTP hoặc FTP (bản này không kèm các storage đám mây như Amazon S3, Dropbox, Google Drive, OneDrive).
4. **Components** - chọn thành phần backup:
   - **Database**
   - **Files**: có thể loại trừ một số folder (cache, log, file dev)
5. Click **Next** để vào bước Scanner.

## Scanner kiểm tra gì

Plugin tự kiểm tra trước khi build:
- Quyền ghi vào thư mục lưu backup
- Kích thước file lớn (mặc định cảnh báo file > 500 MB)
- Tổng kích thước site
- PHP extension cần thiết (zip, openssl, …)
- Memory limit / max_execution_time
- Database size, table engine

Cảnh báo (warning) có thể bỏ qua nếu bạn hiểu rõ. **Lỗi đỏ (error)** thì phải xử lý trước khi build.

## Build phase

Sau khi qua Scanner, click **Build**. Plugin sẽ:

1. Dump database thành file SQL
2. Nén toàn bộ file vào archive
3. Sinh file `installer.php`
4. Upload sang storage đã cấu hình (nếu khác local)

Tốc độ phụ thuộc:
- Kích thước site (chủ yếu `wp-content/uploads`)
- CPU và tốc độ disk của server
- Engine zip đang dùng

## Loại trừ file/folder

Trong **Settings → Package → File Filters**, có thể thêm:
- Folder loại trừ (cache, log, dev tools)
- Extension loại trừ (`.tmp`, `.bak`, …)
- File cụ thể (theo đường dẫn)

Loại trừ giúp giảm size archive và tăng tốc độ build. Tham khảo [Quản lý tài nguyên server](https://phatdev.net/docs/sl-migrations/how-to-manage-server-resources-cpu-memory-disk).

## Tham khảo

- [Xử lý cảnh báo scanner](https://phatdev.net/docs/sl-migrations/how-to-resolve-scanner-warnings-errors-and-timeout-issues)
- [Lên lịch backup tự động](https://phatdev.net/docs/sl-migrations/schedule-backup)
