Bulk move many topics from one category to another

Is there a query to bulk move many topics from one category to another? I want to consolidate many categories into one category and would like to make the move quickly and all at once, and also not bump the topics.

Bonus: also want to tag topics first with a category-equivalent tag before moving them.

Grateful for any queries or recipes. Many thanks! I’d even write it up as a howto topic if it’s good. :slightly_smiling:

7 个赞

我已经清理了这个主题,并添加了解决 OP 中问题的当前最佳选项。如果有什么遗漏或您发现任何问题,请随时回复。

:warning: 在进行任何重大批量更改之前,请务必备份以防万一……

通过 UI 批量标记/移动主题:

对于小型类别或主题子集,批量选择工具可能就足够了(请参阅此帖子末尾关于通知的说明)。

将一个类别中的所有主题移动到另一个类别

首先进入您的站点容器:

cd /var/discourse
./launcher enter app

批量标记类别中的所有主题:

首先进入您的站点容器:

cd /var/discourse
./launcher enter app

我不能 100% 确定这些方法会触发哪种类型的通知,但如果您担心并想绝对确保不会发送通知,我建议在进行此操作时检查以下设置:

  • disable_category_edit_notifications
  • disable_tags_edit_notifications
15 个赞

@tshenry 你真是帮了我大忙!非常感谢!

4 个赞

此主题在上次回复后 30 天自动关闭。不再允许回复。