---
title: "Two-Part Install - Cho site lớn"
url: https://phatdev.net/docs/sl-migrations/two-part-install
lang: vi
updated: 2026-10-20
alternate:
  en: https://phatdev.net/en/docs/sl-migrations/two-part-install
markdown: https://phatdev.net/docs/sl-migrations/two-part-install.md
---

# Two-Part Install - Cho site lớn

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

> Tách bước giải nén và import DB thành hai phase riêng để xử lý site có kích thước lớn.

## Two-Part Install

Dùng cho site **lớn** (>5GB) hoặc khi server có timeout ngắn (thường gặp ở shared hosting). Tách workflow thành hai phase: tự giải nén archive trên server đích, rồi chạy installer qua trình duyệt ở chế độ **Manual Archive Extraction** (giải nén thủ công).

> Lưu ý: cách này dùng archive **ZIP** (build bằng engine ZipArchive hoặc Shell Exec, xem [Zip engines](https://phatdev.net/docs/sl-migrations/how-to-work-with-the-different-zip-engines)) và lệnh `unzip` có sẵn của server. Bản SL Migrations hiện tại không kèm công cụ giải nén dòng lệnh cho file `.daf`, nên archive DupArchive chỉ giải nén được qua `installer.php`.

## Phase 1: Giải nén thủ công

Trên server đích (cần SSH access), đặt `installer.php` và file archive `.zip` vào web root, rồi giải nén ngay trong thư mục đó:

```
unzip archive.zip
```

Toàn bộ nội dung gói phải nằm cùng thư mục với `installer.php`.

Lợi ích: giải nén qua dòng lệnh không bị ràng buộc bởi `max_execution_time` hoặc `memory_limit` của web server.

## Phase 2: Chạy installer

Sau khi file đã giải nén xong, mở:

```
https://example.com/installer.php
```

Installer thấy file `dup-manual-extract__[HASH]` (có sẵn trong gói, nằm trong thư mục `slm-installer`) nên hiện thông báo "Manual extraction detected" và mặc định **bỏ qua bước giải nén**. Muốn giải nén lại, chuyển sang chế độ Advanced, mục Options > Extraction Mode.

Phần còn lại giống Classic Install.

## Khi nào dùng

- Archive **>2GB** (PHP ZipArchive có giới hạn ở build cũ)
- Shared hosting có timeout < 60 giây
- Server đích RAM thấp (giải nén qua PHP web sẽ out of memory)
- Cần kiểm soát tiến độ giải nén qua terminal

## Lỗi thường gặp

- **Giải nén dừng giữa chừng**: `disk_free_space` không đủ. Kiểm tra disk free.
- **Permission denied khi giải nén**: tham khảo [Khắc phục permission](https://phatdev.net/docs/sl-migrations/how-to-fix-file-permissions-issues).
- **Installer vẫn giải nén lại từ đầu**: kiểm tra file `dup-manual-extract__[HASH]` có trong thư mục `slm-installer` không, hoặc chọn "Manual Archive Extraction" ở Advanced > Options.

## Tham khảo

- [DAF file format](https://phatdev.net/docs/sl-migrations/how-to-work-with-daf-files-and-the-duparchive-extraction-tool)
- [Classic Install](https://phatdev.net/docs/sl-migrations/classic-install)
