# 新手从 2.4.0.beta7 更新到 2.7.0.beta7

**URL:** https://meta.discourse.org/t/n00b-updating-from-2-4-0-beta7-to-2-7-0-beta7/189996
**Category:** Self-hosting
**Created:** [2021年五月11日 03:36 UTC](https://meta.discourse.org/t/n00b-updating-from-2-4-0-beta7-to-2-7-0-beta7/189996 "2021-05-11T03:36:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Duane](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/duane/32/220242_2.png) [@Duane](https://meta.discourse.org/u/Duane)
#### Post date: [2021年五月11日 03:36 UTC](https://meta.discourse.org/t/n00b-updating-from-2-4-0-beta7-to-2-7-0-beta7/189996/1 "2021-05-11T03:36:18Z")

</div>

首先……新手警报……请温柔对待！😀

我需要更新我的安装，由于这是第一次更新，我不想弄出什么差错。当然，我会先进行备份……对于首次更新，还有什么需要特别注意的吗？网站会自动下线吗？系统会自动向用户发送相关通知吗？

只是想避免出现“哎呀”的情况。任何建议都感激不尽……先谢过啦！！

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [2021年五月11日 04:08 UTC](https://meta.discourse.org/t/n00b-updating-from-2-4-0-beta7-to-2-7-0-beta7/189996/2 "2021-05-11T04:08:51Z")

</div>

> [@Duane](#):
>
> 我会先进行备份……

务必进行备份。即使一切看似正常，如果你拥有相关的 VPS 功能，或许可以打个主机快照 😅，因为肯定会有数据库更新需要执行。万一出现问题，这通常比从备份恢复更简单（顺便一提，恢复过程本身也值得练习）。作为额外的预防措施，复制一份 app.yml 文件，并记下你当前所在提交的 SHA 值，如何？

从 2.4 升级到 2.7，如果我没记错的话，会涉及一些 PostgreSQL 的更新。不妨先浏览一下这些内容作为热身：[Search results for 'postgresql update' - Discourse Meta](https://meta.discourse.org/search?q=postgresql%20update) 🙂

> [@Duane](#):
>
> 站点会自动离线吗？

是的，在重建期间容器会被停止。

> [@Duane](#):
>
> 系统会自动向用户生成相关通知吗？

没有，至少默认情况下不会。

> [@Add an offline page to display when Discourse is rebuilding or starting up](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238):
>
> warning This guide is intended for advanced users, who are already using nginx outside the docker container. By following this guide you make your setup more complicated and will lose some speed benefits like HTTP2 if you’re not running Ubuntu 16.04 or later. Proceed with caution! When Discourse is rebuilding or starting up, your users will usually either see an error message from their browser… …or a not-so-nice 502 error message from Nginx: If you’re a perfectionist …

---

<div class="post-metadata">

### Author: ![Duane](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/duane/32/220242_2.png) [@Duane](https://meta.discourse.org/u/Duane)
#### Post date: [2021年五月11日 04:10 UTC](https://meta.discourse.org/t/n00b-updating-from-2-4-0-beta7-to-2-7-0-beta7/189996/3 "2021-05-11T04:10:35Z")

</div>

@Benjamin_D 太感谢了！！！这正是我需要的信息！！

---

<div class="post-metadata">

### Author: ![Duane](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/duane/32/220242_2.png) [@Duane](https://meta.discourse.org/u/Duane)
#### Post date: [2021年五月11日 05:35 UTC](https://meta.discourse.org/t/n00b-updating-from-2-4-0-beta7-to-2-7-0-beta7/189996/4 "2021-05-11T05:35:48Z")

</div>

另一个问题……在开始更新之前，该更新是否会扫描已安装的数据库和插件，以确保所有内容都是最新的？

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [2021年五月11日 06:23 UTC](https://meta.discourse.org/t/n00b-updating-from-2-4-0-beta7-to-2-7-0-beta7/189996/5 "2021-05-11T06:23:27Z")

</div>

是的，在重建容器时，启动器会从各自的 Git 仓库拉取最新的插件。如果你在主题或组件中进行了某些修改，你希望保存这些更改。

> [@Restrict editing of remote themes](https://meta.discourse.org/t/restrict-editing-of-remote-themes/170051):
>
> For quite a while, best practice has been to avoid editing themes installed from a remote Git repository locally on Discourse. Any changes to theme code or uploads get wiped out when updating the theme from the remote repo. In this commit, we’ve removed the ability to locally edit a remote theme and are now enforcing this best practice in Discourse. What happens if I have a remote theme with local changes? Nothing at this point. Your theme stays as is until you remove it or update it from re…
