> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/on-premises/vi/bao-tri/data-and-backups/exporting-projects.md).

# Xuất dự án

Trong Server Pro và Community Edition `5.4.0` chúng tôi đã đưa vào một script cho phép quản trị viên xuất tất cả các dự án của người dùng (bao gồm cả những dự án vẫn còn hiển thị trong **Đã xóa** và **Đã chuyển vào thùng rác** các thư mục) ra một thư mục trên đĩa.

{% hint style="info" %}
Kết quả khi chạy script này giống như việc tải xuống thủ công một tệp Zip của tất cả dự án từ bảng điều khiển dự án của người dùng. Script sẽ xóa mọi thay đổi đang chờ xử lý trước khi bắt đầu tải xuống để đảm bảo bản xuất chứa phiên bản mới nhất của dự án.
{% endhint %}

### Giới hạn

Script xuất có các giới hạn sau:

* Không xuất các thiết lập dự án, chẳng hạn như tên ảnh TeX Live hoặc trình biên dịch. Các thiết lập này phải được đặt khi dự án được tải lên tài khoản của người dùng.
* Các dự án đã xuất không chứa bất kỳ lịch sử phiên bản nào.
* Không lưu giữ thông tin cộng tác viên. Các dự án sẽ cần được chia sẻ lại. Nếu dùng chia sẻ bằng liên kết, các liên kết Xem và Chỉnh sửa sẽ được tạo lại (chúng sẽ không giống như trước).
* Mọi bình luận và thông tin theo dõi thay đổi sẽ không được xuất.
* Lịch sử trò chuyện của dự án sẽ không được xuất.

{% hint style="danger" %}
Script này **không** được thiết kế để thay thế cho một bản sao lưu hệ thống đầy đủ. Để đảm bảo bạn có thể khôi phục phiên bản của mình trong một kịch bản khôi phục sau thảm họa, chúng tôi **rất** khuyến nghị thực hiện một [bản sao lưu nhất quán](https://docs.overleaf.com/on-premises/maintenance/data-and-backups/..#performing-a-consistent-backup).
{% endhint %}

### **Các cờ**

| Tên            | Mô tả                                                                                 |
| -------------- | ------------------------------------------------------------------------------------- |
| `--help`       | Hiển thị trợ giúp                                                                     |
| `--user-id`    | ID người dùng (bắt buộc trừ khi dùng `--export-all` hoặc `--project-id`)              |
| `--project-id` | Xuất một dự án duy nhất (**không thể** được dùng với `--user-id` hoặc `--export-all`) |
| `--list`       | Liệt kê các dự án của người dùng (**không thể** được dùng với `--output`)             |
| `--output`     | Tệp zip đầu ra (cho các thao tác xuất một dự án)                                      |
| `--export-all` | Xuất các dự án của tất cả người dùng (yêu cầu `--output-dir`)                         |
| `--output-dir` | Thư mục để lưu trữ các tệp xuất của tất cả người dùng                                 |
| `--log-level`  | Các mức nhật ký được hỗ trợ: `trace`\|`debug`\|`info`\|`warn`\|`error`\|`fatal`       |

### **Cách sử dụng**

Dùng lệnh sau để xuất các dự án cho tất cả người dùng:

{% code overflow="wrap" %}

```bash
# Người dùng Overleaf Toolkit
$ bin/docker-compose exec sharelatex /bin/bash -ce "cd /overleaf/services/web && node modules/server-ce-scripts/scripts/export-user-projects.mjs --export-all --output-dir=/var/lib/overleaf/data/exports"

# Người dùng docker-compose.yml kiểu cũ
docker exec sharelatex /bin/bash -ce "cd /overleaf/services/web && node modules/server-ce-scripts/scripts/export-user-projects.mjs --export-all --output-dir=/var/lib/overleaf/data/exports"
```

{% endcode %}

{% hint style="info" %}
Nếu bạn đang chạy Server Pro hoặc Community Editition <= 3.5.13, bạn sẽ cần cập nhật ví dụ ở trên để dùng **`export-legacy-user-projects.js`** script.
{% endhint %}

### **Hoàn tất**

Sau khi quá trình xuất hoàn tất, bạn có thể truy cập các tệp qua thư mục trên máy chủ được gắn kết vào **/var/lib/overleaf** trong **docker-compose.yml** hoặc `OVERLEAF_DATA_PATH` biến môi trường trong **config/overleaf.rc** tệp nếu bạn đang dùng Toolkit.

{% hint style="info" %}
Overleaf hiện cho phép các tên dự án trùng nhau. Nếu dự án của một người dùng chứa bản trùng, các dự án này vẫn sẽ được thêm vào tệp Zip xuất của người dùng, nhưng khi giải nén, chỉ có một phiên bản sẽ hiện diện. Trên Linux, `unzip -B` sẽ ghi các tệp có cùng tên thành các tệp sao lưu thay vì ghi đè.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/on-premises/vi/bao-tri/data-and-backups/exporting-projects.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
