# 在本地恢复下 Discourse 来研究下数据库

**URL:** <https://www.isharkfly.com/t/discourse/18436>\
**Category:** Discourse\
**Tags:** discourse, postgresql\
**Created:** [November 16, 2025, 3:37pm UTC](https://www.isharkfly.com/t/discourse/18436 "2025-11-16T15:37:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hex](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hex/32/21953_2.png) [@hex](https://www.isharkfly.com/u/hex)\
**Post date:** [November 16, 2025, 3:37pm UTC](https://www.isharkfly.com/t/discourse/18436/1 "2025-11-16T15:37:02Z")

</div>

虽然一直不怎么用 PGSQL，但最近几个项目感觉 PGSQL 比 MySQL 更有研究价值。

本地恢复下 Discourse 的数据库也好顺便研究下。

 ![2025-11-16_10-34-22](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/3X/c/5/c5431fc3b09047822194836a395692d617ef5c0c.png)

## 恢复命令

下面的命令是在 PgAdmin 下执行的：

```auto
isharkfly_www-# \i 'C:/Users/yhu/Downloads/dump.sql'

```

 ![2025-11-16_10-36-45](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/3X/e/2/e281b5b737622370fe46c8d4fbba29870d5f490f.png)

主要是 Windows 下的路径问题。

---

<div class="post-metadata">

**Author:** ![tom\_eric](https://www.isharkfly.com/user_avatar/www.isharkfly.com/tom_eric/32/20785_2.png) [@tom\_eric](https://www.isharkfly.com/u/tom_eric)\
**Post date:** [November 17, 2025, 2:27pm UTC](https://www.isharkfly.com/t/discourse/18436/2 "2025-11-17T14:27:34Z")

</div>

谢谢分享 我也打算学习一下。

---

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [November 17, 2025, 3:04pm UTC](https://www.isharkfly.com/t/discourse/18436/3 "2025-11-17T15:04:03Z")

</div>

Discourse 用的是 PGSQL 数据库。

对比 MySQL 来说有点使用门槛，但性能上没得说。

现在手上不少项目都在迁移到 PGSQL。

---

<div class="post-metadata">

**Author:** ![tom\_eric](https://www.isharkfly.com/user_avatar/www.isharkfly.com/tom_eric/32/20785_2.png) [@tom\_eric](https://www.isharkfly.com/u/tom_eric)\
**Post date:** [November 17, 2025, 3:40pm UTC](https://www.isharkfly.com/t/discourse/18436/4 "2025-11-17T15:40:24Z")

</div>

哈哈 我之前国外的服务器过期了 现在用国内服务器搭的discourse玩玩,没备案 第二天就被电信封443了。

现在先改到3443端口 发现端口映射属于 **容器创建时参数** ，重启现有容器无法生效。

又得重建一次了。

---

<div class="post-metadata">

**Author:** ![hex](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hex/32/21953_2.png) [@hex](https://www.isharkfly.com/u/hex)\
**Post date:** [November 17, 2025, 4:01pm UTC](https://www.isharkfly.com/t/discourse/18436/5 "2025-11-17T16:01:28Z")

</div>

是的，现在国内对社区类的系统管理比较严格，而且类似这种内容通常备案是不让过。

同时，Docker 容器那边下载和处理也不容易。

可能把服务器放相对宽松点的地方更好。

而且备案他们会随时检查，如果你要在腾讯备案，那服务器就必须在腾讯。

就算备案成功了，腾讯方面也会对网站内容进行抽查，如果发现备案内容和网站内容不匹配，腾讯会要求你现时整改，否则就停服。

---

<div class="post-metadata">

**Author:** ![tom\_eric](https://www.isharkfly.com/user_avatar/www.isharkfly.com/tom_eric/32/20785_2.png) [@tom\_eric](https://www.isharkfly.com/u/tom_eric)\
**Post date:** [November 17, 2025, 4:04pm UTC](https://www.isharkfly.com/t/discourse/18436/6 "2025-11-17T16:04:03Z")

</div>

谢谢回复 我打算黑五的时候买个美国主机 建站加代理上网用。

可能还得再买个干净的落地ip。
