# 将您的 Discourse 实例迁移到不同的服务器

**URL:** https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721
**Category:** Self-Hosting
**Tags:** migrations, how-to
**Created:** [2014 年5 月 16 日 20:56 UTC](https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721 "2014-05-16T20:56:27Z")
**Posts on this page:** 1
**Showing post:** 104

<div class="post-metadata">

### Author: ![Ethsim2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethsim2/32/522255_2.png) [@Ethsim2](https://meta.discourse.org/u/Ethsim2)
#### Post date: [2026 年8 月 11 日 08:28 UTC](https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721/104 "2026-08-11T08:28:07Z")

</div>

在此补充一个我在迁移过程中遇到的边缘情况，希望能帮助到其他遇到类似问题的人。

在将独立的 Discourse 实例迁移到新 VPS 时，我遇到了一个 Let’s Encrypt/SSL 的边缘情况，因此我记录了详细的诊断和恢复步骤，希望这对其他按照本指南操作的人有用。

在我的案例中，`app` 内的 nginx 无法启动，因为 `/var/discourse/shared/standalone/ssl/` 中的两个 `.cer` 文件都变成了零字节文件：

```plaintext
PEM_read_bio_X509_AUX() failed

```

重新构建尝试再次签发证书，经过多次尝试后，我触发了 Let’s Encrypt 的证书速率限制。仅从旧服务器复制仍然有效的证书文件是不够的，因为启动 `app` 会再次将它们替换为零字节文件。

最终解决问题的方法是停止 `app`，并从旧服务器复制 **工作正常的** `/var/discourse/shared/standalone/ssl/` 目录 **以及** 对应的 `/var/discourse/shared/standalone/letsencrypt/` 状态，然后再次启动容器。

我已在此处记录了完整的步骤：

> <https://github.com/Ethsim12/discourse/blob/501161fbf064d2e574b3494f87bd3dcf93ef2cfa/server_migration_diagnosing_standard_ssl.md>

这些是针对此次特定迁移的诊断/恢复笔记，而非官方迁移或 HTTPS 文档的替代品。

还有一个较旧的 Meta 主题涵盖了相关的零字节 `.cer` 故障模式：

> [@Let's Encrypt：\*.cer 文件为空](https://meta.discourse.org/t/lets-encrypt-empty-cer-files/135241):
>
> 我无法连接到新的 [标准 30 分钟安装](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)。环境为 AWS Lightsail，2GB 内存，Ubuntu 18.04 LTS x64，已开放 :443 端口。问题是 Let’s Encrypt 的 \*.cer 文件为空。原因是什么？ nginx 日志 root:/var/log/nginx# ls -ltrh -rw-r–r-- 1 www-data www-data 0 Dec 6 05:45 error.letsencrypt.log -rw-r–r-- 1 www-data www-data 0 Dec 6 05:45 access.letsencrypt.log -rw-r–r-- 1 www-data www-data 1.8M Dec 6 08:19 error.log tail error.log PEM\_read\_bio\_X509\_AUX() failed (SSL: error:0909006C:PEM routines:get\_name:no start line:Expecting: TRUSTED CERTIFICATE) 非…

---

_[View the full topic](https://meta.discourse.org/t/move-your-discourse-instance-to-a-different-server/15721)._
