# 重烘焙旧帖子在重命名 S3 存储桶后不会拉取新的 S3 CDN URL

**URL:** <https://meta.discourse.org/t/rebaking-old-posts-wont-pull-new-s3-cdn-url-after-s3-bucket-rename/175882>\
**Category:** Self-hosting\
**Created:** [2021年一月12日 16:20 UTC](https://meta.discourse.org/t/rebaking-old-posts-wont-pull-new-s3-cdn-url-after-s3-bucket-rename/175882 "2021-01-12T16:20:52Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Brad\_Wood](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brad_wood/32/204558_2.png) [@Brad\_Wood](https://meta.discourse.org/u/Brad_Wood)\
**Post date:** [2021年一月12日 18:34 UTC](https://meta.discourse.org/t/rebaking-old-posts-wont-pull-new-s3-cdn-url-after-s3-bucket-rename/175882/5 "2021-01-12T18:34:53Z")

</div>

@Falco 再次感谢。我执行了两次重映射：

```plaintext
DbHelper.remap("ortus-discourse.s3.dualstack.us-west-2.amazonaws.com", "communitycdn.ortussolutions.com")
DbHelper.remap("ortus-discourse-uploads.s3.dualstack.us-west-2.amazonaws.com", "communitycdn.ortussolutions.com")

```

我重新构建了镜像，这解决了网站页头徽标等问题。我现在正在重新处理所有帖子，看看是否能修复帖子中的图片，但这需要一些时间。

* * *

在等待重新处理的过程中，这里到底出了什么问题？这是 Discourse 的一个 bug 吗？导致我的上传内容卡在旧 URL 上，无法切换到新 URL？

我阅读了像这样的一篇帖子，它讨论了更改 CDN URL，但其中只提到了替换帖子中的字符串（这并没有起作用），完全没有提及 DbHelper 重映射。[How do I change the legacy CDN URLs of images in posts?](https://meta.discourse.org/t/how-do-i-change-the-legacy-cdn-urls-of-images-in-posts/97518)

我甚至尝试重新运行导入到 S3 的 rake 脚本，但收到了一个错误（抱歉，我当时没有记下具体错误信息）。

我还发现了一个 `migrate_from_s3` rake 脚本，差点就运行它看看能否从头开始，但后来我发现了 [这里的一篇论坛帖子](https://meta.discourse.org/t/migrate-from-s3-problems/119064/16?u=brad_wood)，其中指出如果我运行它，会破坏我的数据库，所以我没有碰它。

我现在不知道当初应该怎么做才对，或者哪篇论坛帖子能解答我的问题。（在发帖之前，我确实非常努力地尝试自己解决这个问题！）

---

_[View the full topic](https://meta.discourse.org/t/rebaking-old-posts-wont-pull-new-s3-cdn-url-after-s3-bucket-rename/175882)._
