将 phpBB3 论坛迁移到 Discourse

I can at least say that it not only happens for those cases where older posts link to newer ones.

I got one example where I first found the issue.

Original Post ID: 842948 links to Page 22 of a thread that already existed and at least the start post (&start=220) has an ID lower than the linking post (842880)

After import this original post (which was posted only days before the dump was created) links to a 7 year old thread where the first post has an original ID of 1353.

I can’t seem to find any hints on why this happens, any similarities in numbers in any way… The original link was just a plain posted URL which was auto linked by phpBB. Those links in general don’t cause any issues - they work in several other places.

Generally I don’t expect the import to go well immediately. I’m really happy to how it went so far but I assume this issue might be one of the hardest to fix, especially because I don’t have any clue of setting up a dev/debug environment with Discourse yet. Might need to dig into that soon.

3 个赞

Hi,
From what I remember, the phpbb importer was by default filling the Discourse user full name by guessing from the user email address. Am I right and is it still the case? I can’t find anything about this in the importer files…

This is something I wouldn’t want to happen in the next forum I may import.

Also, another question.

On the current phpbb forum, there are custom user fields (like users facebook or instagram urls). I would like to import this in Discourse custom fields. I guess I’ll do something like first installing and configuring Discourse by adding these custom user field, then importing the phpbb data from my custom import script?

1 个赞

That’s not happening anymore.

That sounds like a good plan.

6 个赞

Is there a reliable way to estimate the monthly volume of emails that Discourse will send to users after a migration from phpbb? New user registrations, mentions and replies, weekly digests and so on… Phpbb sends very few emails by default and I think we’ll have to change the current email provider.
I don’t currently have much stats from the actual phpbb. It exists since 2013, with 200000 messages and 5500 members. New members register everyday.

1 个赞

How many posts per day?

1 个赞

I dont know yet. I have currently nothing but the public stats. Maybe 20.

1 个赞

With only 20 posts per day I think you’d probably be looking at 3000 emails a month, at most, well within the free Mailgun plan.

However seeing as you’re migrating with lots of users I’d recommend you turn off the digest emails for everyone who hasn’t been to your forum within the last month or two (they can always turn it on themselves if they want). You can do that with a query in the Rails console, but it’s been a year since I did it for mine, so I don’t remember the exact code sorry.

That should actually be something the import script could do for you IMO, ideally with a setting for the time since last visit to enable digest emails.

4 个赞

I disagree. That’s not something an import script should do, but there’s a site setting for this: suppress digest email after days

4 个赞

Indeed :slight_smile: After my first phpbb import on my current forum, I had to decrease the default value; my email provider automatically blocked the used address because of all the digest emails sent. It was flagged as spam.

1 个赞

It’s not quite the same thing. There’s a difference IMO between sending digest emails to someone for X months since their last visit when they signed up for it - just because they don’t visit the forum doesn’t mean they’re not reading the digest emails - and sending digest emails to a user who never signed up for them because they registered in the previous forum, which may not even be legal in some jurisdictions! You could simply turn off digests for every migrated user, and they can turn then on for themselves, or you could do as I did and turn them off for everyone except those who visited within the last month and who therefore would have seen the “we’re going to migrate the forum soon” announcement. I think that’s a fair middle ground.

It’s also practical - our phpBB forum had gained thousands of spammer accounts within the last year and sending the digest to them four times a month would have used all our free mailgun allowance and then started costing a lot. Reducing “clean up inactive users after days” eventually cleaned them up.

5 个赞

不确定该内容是否适合放在这里,还是应该单独开一个话题。但既然涉及从 phpBB 3 迁移,我就在此提出。

我已成功将数据迁移到 Discourse,目前使用的是单个数据库。不过,我有三个独立且不同的社区(三种不同语言,三个不同的 phpBB 安装),理想情况下,我希望将它们全部合并为一个统一的 Discourse 论坛。

我的问题是:该如何实现这一点?我需要在导入脚本、phpBB 3 数据库或其他任何地方进行哪些更改?

有一些用户在多个论坛都拥有账户(甚至可能三个论坛都有),但由于没有单点登录(SSO),他们在每个论坛上的账户虽然用户名相同,但实际上是不同的账户。这些安装彼此独立,数据库也各不相同。

如果这能够实现,那就太棒了!

提前感谢大家的帮助!

1 个赞

它无法开箱即用,因为导入脚本会将原始 ID 存储到 Discourse 数据库中,如果发现有相同 ID 的记录,它将不会导入来自其他论坛的数据。不过,我想到了两种解决方法:

  1. 困难方案:你需要在多个位置编辑导入脚本,并为帖子、主题、分类和用户的 import_id 自定义字段添加每个论坛的前缀。

  2. 简单方案,但你将失去增量导入的能力:在每次导入后删除自定义字段。

    TopicCustomField.where(name: 'import_id').delete_all
    PostCustomField.where(name: 'import_id').delete_all
    CategoryCustomField.where(name: 'import_id').delete_all
    UserCustomField.where(name: 'import_id').delete_all
    

方案 2 尚未经过测试,但理论上应该可行。在尝试之前,请创建备份。

7 个赞

新年前的初步测试结束后,我们现在重新推进迁移项目。目前最大的问题之一是内部链接重写失败,我正在思考如何最佳地处理这一问题。

@gerhard 我的编程知识非常基础,对 Rails 整体以及 Discourse 的详细结构几乎一无所知。因此,请允许我提出这个问题:是否有可能处理这种情况,即导入器无法根据链接中的 ID 找到已导入的帖子?或许可以不用将其替换为错误的链接,而是附加一段文字,告知用户或管理员,并在导入后使这些有问题的链接可被查找?

我目前最担心的是,现有的处理方式会让这些链接看起来像是已成功替换,导致导入后无法找到并手动修复它们。

非常感谢您能提供的任何帮助,我十分感激。

1 个赞

一种方法是重写脚本,使其在所有帖子导入完成后再替换这些链接。如果您需要帮助且有预算,可以联系我或在 Marketplace 发帖。

4 个赞

不幸的是,该项目预算有限,我想这个问题还不至于重要到值得为此花钱,但得知您愿意提供帮助确实很好。

还有一个问题:我注意到在导入时,bbcode 似乎被以不同的方式处理。例如,[size] 标签会被保留为纯文本,而 [color] 标签则似乎被完全移除。我想复用颜色功能,发现有一个 Discourse 插件可以实现,但后来注意到它在导入时似乎也被移除了。初始帖子提到 bbcode 可以导入,但我找不到任何设置来控制哪些 bbcode 可以被导入或不被导入。

如果有办法的话,我更倾向于移除 size 标签,而保留 color 标签。我是否遗漏了关于如何处理这些标签的某些内容,以及是否有办法进行更改?

1 个赞

我刚刚发现,我 phpbb 论坛中已被修剪(pruned)的话题,我以为它们已经消失了,却不知何故被转移到了 Discourse。

这怎么可能呢?

1 个赞

我正尝试这样做,但被说明搞糊涂了。你指的是哪个设置文件?我应该在导入之前还是之后进行这个操作?
先谢谢你!

编辑:所以我想你指的是管理后台中的表情符号设置文件?有没有办法通过导入文本文件之类的方式来完成这个操作?我有大约 100 个自定义笑脸,希望能以某种方式将这些映射复制到 Discourse 中,这可能吗?(我能否以某种方式将 smilies.pak phpbb 文件复制到 Discourse 设置中?)

1 个赞

你确实看到了导入器的设置文件吧?:wink:

3 个赞

我想 phpBB 对修剪主题的处理方式与常规删除主题不同。在这种情况下,目前还不支持。你需要弄清楚 phpBB 如何标记修剪主题为已删除,并修改导入脚本。

3 个赞

对对对,当然!我上次做第一次转换已经是很久以前的事了,我完全把那件事给忘了,谢谢提醒!

关于被修剪的话题,是的,我也以为是那样。这对我的论坛来说不是什么大问题,但确实挺让人意外的,也许可以提前告知其他人可能会出现这种情况。

1 个赞