> 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/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 映像的隔離網路設定，請設定 `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://overleaf-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.
