# 从 2.3.0 升级到 2.8.1 失败

**URL:** <https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132>\
**Category:** Self-hosting\
**Created:** [2022年三月5日 03:48 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132 "2022-03-05T03:48:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)\
**Post date:** [2022年三月5日 03:48 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/1 "2022-03-05T03:48:57Z")

</div>

我需要确定我所经历的是否正常。

SSL证书过期，强制重建应用程序失败。

升级失败后，我不得不这样做：

- 从 `data_dir` 文件重建数据库 - ✅
- 备份上传文件 - ✅
- 在本地安装 Discourse，将数据库指向现有数据库 - ✅
- 运行迁移以更新数据库 - ✅

现在我卡在尝试启动 Discourse rails `rails s -b 0.0.0.0` 进行测试。

 ![screenshot_2022-03-04_20:40:20](https://global.discourse-cdn.com/meta/original/3X/1/3/13502e5f9948a20a320710dbb958526e53d4d85f.png)

命令行在过去 24 小时内一直产生类似这样的事务输出。

我想知道如何提高此过程的速度？ 另外，是否有办法检查它取得了多少进展/还剩下多少作业？

我正在尝试在本地生成备份，然后将其上传到在线。

谢谢。

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2022年三月5日 15:11 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/2 "2022-03-05T15:11:47Z")

</div>



---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2022年三月5日 15:12 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/3 "2022-03-05T15:12:52Z")

</div>

> [@will\_io](#):
>
> 命令行已经产生了超过24小时的交易输出，如下所示。

你并没有卡住，你运行的那个命令会启动一个网络服务器并一直运行，直到你手动停止它。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2022年三月5日 15:25 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/4 "2022-03-05T15:25:48Z")

</div>

这似乎不是标准安装？

建议备份并迁移到该设置。

---

<div class="post-metadata">

**Author:** ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)\
**Post date:** [2022年三月5日 16:31 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/5 "2022-03-05T16:31:06Z")

</div>

我最终通过将 Discourse 容器化部署到 Web 服务器上实现了我需要的功能。谢谢。

此后我遇到的问题：

- `unique_index_categories_on_slug`，这源于迁移，但实际的罪魁祸首是分类中第二个未分类的 slug - 通过重命名 slug 解决
- 自定义头像未显示 - 通过 `rake uploads:regenerate_missing_optimized` 解决

目前我正卡在尝试为插件正确配置 `app.yml`：

```plaintext
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-bbcode.git
          - git clone https://github.com/discourse/discourse-plugin-linkedin-auth.git
        cd: $home
        cmd:
          - git fetch --depth=1 origin tag v2.8.1 --no-tags
          - git checkout v2.8.1

```

插件从未安装。我注意到输出中显示 `LOAD_PLUGINS=0`，尽管我尝试将其重新定义为 `LOAD_PLUGINS=1`。

有什么建议吗？

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2022年三月5日 19:47 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/6 "2022-03-05T19:47:44Z")

</div>

您执行了标准安装吗？

您是否在添加插件后执行了

```
 ./launcher rebuild app

```

---

<div class="post-metadata">

**Author:** ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)\
**Post date:** [2022年三月5日 23:56 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/7 "2022-03-05T23:56:11Z")

</div>

> [@pfaffman](#):
>
> 您是否执行了标准安装？
> 
> 在添加插件后，您是否执行了
> 
> ```
> ./launcher rebuild app
> 
> ```

我绝对遵循了 Web 服务器的官方安装说明。我可以进入应用程序并将存储库克隆到插件文件夹中，但无法使用 `./launcher rebuild app` 来拉取插件。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2022年三月6日 00:25 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/8 "2022-03-06T00:25:25Z")

</div>

与其检出 v2.8.1，不如直接使用稳定分支？

---

<div class="post-metadata">

**Author:** ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)\
**Post date:** [2022年三月7日 22:04 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/9 "2022-03-07T22:04:55Z")

</div>

我“好多了”，几乎恢复到 100% 的体内平衡。感谢你们两位的帮助。

考虑到我有一个专门讨论我升级的主题，同样，你们两位的关注，我有一个关于表格数据的问题。

我在帖子中有表格，这些表格引用了网络上的静态图片（在可预见的未来永远不会改变：

```plaintext
|列 A|列 B|列 C|列 D|
|-|-|-|-|
|测试 A1|测试 B1|<img height=20 src="https://example.com/images/Test_C1.png">|测试 D1|
|测试 A2|测试 B2|<img height=20 src="https://example.com/images/Test_C2.png">|测试 D2|

```

我该如何告诉 discourse 接受表格内图片的特定高度和宽度？之前的 Discourse 版本能够做到这一点。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2022年三月8日 00:08 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/10 "2022-03-08T00:08:20Z")

</div>

我认为那使用的是不同的 markdown 引擎，而且那不再是合法的做法了。我认为你需要将其转换为纯 markdown，这可能有点棘手。也许 Rafael 有个主意。

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2022年三月8日 00:57 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/11 "2022-03-08T00:57:47Z")

</div>

```plaintext
<img width="20" height="20" src="https://global.discourse-cdn.com/meta/original/3X/9/4/94121285d841eba5a7889a338a9baac04b3a6e79.png"/>

```

变成

 ![](https://global.discourse-cdn.com/meta/original/3X/9/4/94121285d841eba5a7889a338a9baac04b3a6e79.png)

看起来已经可以了？别忘了引号。

---

<div class="post-metadata">

**Author:** ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)\
**Post date:** [2022年三月8日 03:42 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/12 "2022-03-08T03:42:23Z")

</div>

为了进行测试和澄清，除了引用之外，您现在还说图片需要 `height` 和 `width` 属性才能有效地改变大小？请看下面的示例，其中对此感到困惑：

**编辑器中的代码：**

```plaintext
|Column A|Column B|Column C|Column D|
|-|-|-|-|
|Test A1|Test B1|<img height="20" width="20" src="https://global.discourse-cdn.com/meta/original/3X/9/4/94121285d841eba5a7889a338a9baac04b3a6e79.png">|Test D1|
|Test A2|Test B2|<img height="20" src="https://global.discourse-cdn.com/meta/original/3X/9/4/94121285d841eba5a7889a338a9baac04b3a6e79.png">|Test D2|

```

**编辑器预览：**

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/0/90e3665bdc20f04e2924993e5b1dbfde598e87e1.png)

**实际帖子：**

| Column A | Column B | Column C | Column D |
| --- | --- | --- | --- |
| Test A1 | Test B1 | ![](https://global.discourse-cdn.com/meta/original/3X/9/4/94121285d841eba5a7889a338a9baac04b3a6e79.png) | Test D1 |
| Test A2 | Test B2 | ![](https://global.discourse-cdn.com/meta/original/3X/9/4/94121285d841eba5a7889a338a9baac04b3a6e79.png) | Test D2 |

在我安装的帖子表格中的图片看起来像 **编辑器预览** 截图，而不是 **实际帖子** 中的自动调整大小的版本。

再次感谢，各位。

---

<div class="post-metadata">

**Author:** ![will\_io](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_io/32/147541_2.png) [@will\_io](https://meta.discourse.org/u/will_io)\
**Post date:** [2022年三月8日 20:25 UTC](https://meta.discourse.org/t/failed-upgrade-from-2-3-0-to-2-8-1/220132/15 "2022-03-08T20:25:12Z")

</div>

另外，我注意到在运行 `rake posts:rebake` 后，较大的图片不再可点击，也无法在灯箱画廊中打开，而灯箱画廊在很多帖子中都有使用。有什么建议吗？
