迁移 FluxBB 同时保留传入链接

Hello everyone,

I’m planning a migration of an existing community (macscripter.net - Mac OS Automation discussions) hosted with FluxBB to Discourse. This article looks promising in terms of migrating the data. Its going to be a big job as I have over 30,000 users, and 120K posts but it seems doable.

However, I want to preserve all the incoming links. macscripter.net is a significant reference for the Apple automation community. We’ve got almost 20 years of posts with a lot of references to the site appearing on other sites and in mailing list archives which I don’t want to break.

I’m looking for a way to translating incoming FluxBB post links to corresponding Discourse posts? I don’t see any way to accomplish this with stock Discourse so I’m presuming I’ll need to create some sort of plugin that responds to FluxBB’s /viewtopic.php?id=##### links and redirects to the appropriate Discourse link. If anyone else has experience solving this kind of problem, I would love to hear how you approached it.

I appreciate any suggestions.

Cheers
-Mark

1 个赞

Most import scripts create permalinks that handle the redirects. I don’t know offhand if they one does. If not, you can look at one of the others for example code.

2 个赞

我也有同样的问题,我对答案有点困惑。我也想做一个相当大的 FluxBB 导入。

我看到 Discourse 中有一个名为“永久链接”(Permalinks)(https://meta.discourse.org/t/how-to-make-a-redirect-url-in-a-discourse-install/40973/4)的功能,所以我们说通过创建这些东西,Discourse 可以将 FluxBB 风格的 URL,例如“/viewtopic.php?id=((old topic id))”,重定向到“/t/((new topic slug))/((new topic id))”。也许对主题中的单个帖子也一样?用户个人资料 URL 也一样。(所以我们需要很多永久链接)。我看到了永久链接的数据库表。

这听起来像一个很棒的解决方案,但 FluxBB 导入器没有创建任何永久链接。我找不到任何相关的代码。事实上,我在任何导入脚本中都找不到任何用于此目的的代码(没有提到“Permalink”ActiveRecord 模型)。

我很乐意修改 fluxbb 导入器来完成这项工作,但其他导入器中有示例吗?

确实在代码中看到的唯一类似的东西是初始化“LookupContainer”并存储所有旧 ID 及其对应的新 ID。这可以用于创建许多 Permalink 对象吗?

对了。

查看 vbulletin 导入器(还有 answerhub、vanilla、mylittleforum、bbpress、drupal 等——也许你进行了区分大小写的搜索或其他操作),它在 import_topics 函数中执行此操作(忽略 permalink 文件函数)。您将需要添加永久链接的代码以及一个 permalink_normalization,将 fluxbb URL 映射到您创建的任何永久链接。

呀!你说得对。我的 IDE 搜索在捉弄我。事实上,有很多“Permalink”对象的创建示例。所以也许我会考虑将此添加到 FluxBB 导入中。

我想知道你的大型导入进行得怎么样了,@alldritt。嗯,看起来 macscripter.net 仍然在使用 FluxBB,所以进行得不太顺利? :slight_smile: 如果你注意到 fluxbb 导入器没有很好地转换 bbcode,我一直在努力修复这些问题:Pull request in progress

这些讨论之间存在一个有趣的(尴尬的)重叠,因为 FluxBB 支持 [post=123] 形式的 bbcode,通过 ID 链接到另一个帖子(引用源 FluxBB 系统中的旧帖子 ID)。如果我们有一个解决方案来重定向这些 ID,处理起来会更容易。

1 个赞

不会的。永久链接仅适用于外部链接,不适用于内部链接。您需要编写一些内容来重写这些内部链接,使其成为 Discourse 的引用。也有这方面的示例。

感谢您重新开启这个话题!

我尝试了几次转换,但都放弃了。随着我换用了 M1 Mac,我失去了 Discourse 测试环境,并且从未抽出时间重新创建它。我希望一旦有空闲时间,能尽快回到这个项目。处理现有链接的重定向是我一直在努力解决的问题。我还没有来得及验证所有的 BBCode 是否都已正确翻译。我有超过 130,000 条帖子需要转换,这让人望而生畏。

希望这对您有所帮助。昨天我正在做一些工作,为 FluxBB 导入器添加 create_permlinks 功能。

目前这部分内容在我正在进行中的拉取请求中。请参阅提交 “为 FluxBB 导入器添加永久链接创建逻辑” 在此列表的末尾。我希望在某个时候将所有这些合并,可能顺序不同(我目前正在等待有人审查这个基础拉取请求作为起点)

因此,这将为四种不同类型的 FluxBB URL 创建重定向。

  • profile.php?id=<user id>
  • viewtopic.php?pid=<post id>
  • viewtopic.php?id=<topic id>
  • viewforum.php?id=<forum id>

我认为这四种涵盖了人们希望保留工作链接的所有内容。您怎么看?


回到 FluxBB 的特殊内部链接主题

我不会尝试将它们保留为新 discourse 中的内部链接。懒惰的解决方案:它们将链接到旧的 fluxbb 论坛 URL(作为完整 URL,因此是外部链接),由于这些永久链接,然后将用户重定向回新 discourse 中的正确位置。

我认为你懒惰的解决方案可能会奏效。如果你愿意,可以找到重写内部链接的例子,但懒惰也可能很好。

1 个赞