> For the complete documentation index, see [llms.txt](https://ayakaleaf-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://ayakaleaf-pro.ayaka.space/on-premises/zh-tw/wei-hu/upgrading-your-deployment.md).

# 升級您的部署

{% hint style="danger" %}
重要的是要確保你在 [一致性備份](/on-premises/zh-tw/wei-hu/data-and-backups.md#performing-a-consistent-backup) **之前** 每次主要版本升級時都備份，以便在需要時回復。
{% endhint %}

該 [Overleaf Toolkit↗](https://github.com/overleaf/toolkit) 是一個 git 倉庫，因此很容易取得新的 Toolkit 功能。只要執行 `bin/upgrade` 命令，並依照螢幕上的提示操作。

值得注意的是，Docker 映像版本（在 `config/version`）與 Toolkit 程式碼更新是分開管理的。更新 Toolkit 程式碼將會 **不要** 自動變更您正在執行的 Docker 映像版本。這表示在大多數情況下，您可以在不升級部署的情況下升級 Toolkit 版本。

#### 該 `bin/upgrade` 腳本

當您執行 `bin/upgrade` 命令時，腳本會檢查是否有可用的 Toolkit 程式碼更新，並提供更新您的 Toolkit。您隨時都可以拒絕此升級，且不會有任何變更。

如果您選擇更新 Toolkit 程式碼，腳本接著會檢查 *預設* Docker 映像版本是否已變更，並提供升級您的本機版本檔案（位於 `config/version`）以符合新的預設值。

如果您選擇切換版本，腳本接著會引導您完成關閉 Docker 服務、進行備份，以及重新啟動 Docker 服務的流程。您的舊版本檔案將自動複製到 `config/__old-version`，以防您需要回復到該版本的 Docker 映像。

{% hint style="danger" %}
在執行 Server CE/Pro 升級時，我們建議先升級到目前部署的主要版本的最新發行版 **之前** 再升級到 **下一個** 主要版本的最新發行版。如果你的部署版本比最新版本落後超過一個主要版本，你將需要執行多階段升級。

例如，如果你正在執行 3.5.10，你需要升級到 3.5.13 -> 執行完整專案歷史記錄遷移 -> 4.2.9 -> 5.5.4。

你應該 **絕不要** 跳過主要版本（3.5.10 -> 5.5.4）。如果你使用 Toolkit，且比最新版本落後超過一個主要版本，你必須 **不要** 使用 `bin/upgrade` 此指令碼，因為你將需要執行手動多階段升級。
{% endhint %}

{% hint style="info" %}
對於會手動匯入 Docker 映像的離線（air-gapped）設定，請設定 `PULL_BEFORE_UPGRADE=false` 在您的 `config/overleaf.rc` 檔案。

請查看 [這裡](/on-premises/zh-tw/an-zhuang/air-gapped-offline-deployments.md) 以取得更多有關在離線/無網路環境中部署的資訊。
{% endhint %}

### 升級路徑 <a href="#upgrade-path" id="upgrade-path"></a>

該 `bin/upgrade` 命令一律會選擇當時可取得的最新 Server Pro/CE 版本。如果您的升級週期不頻繁，這可能會導致跳過主要版本，並有可能升級到您未預期的版本。

執行升級時，我們建議先升級到目前主要版本的最新發行版，再升級到下一個主要版本的最新發行版。例如，如果您目前執行的是 3.3.2，而可用的最新版本是 5.3.1，正確的升級路徑會是：

* 3.3.2 -> 3.5.13
* 3.5.13 -> 4.2.9
* 4.2.9 -> 5.5.1

為避免任何升級問題，我們建議您參考我們的 [發行說明](https://docs.overleaf.com/on-premises/release-notes) ，再進行任何升級，因為某些版本可能需要額外步驟，例如手動變更 Toolkit、升級資料庫或執行遷移腳本。

如果您還沒有這麼做，請訂閱我們的 [郵件名單](https://mailchi.mp/overleaf.com/community-edition-and-server-pro) ，以便在有新版本/更新發佈時收到通知。這樣您就能安排與我們發佈時程密切配合的定期維護時段。


---

# 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://ayakaleaf-pro.ayaka.space/on-premises/zh-tw/wei-hu/upgrading-your-deployment.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.
