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:

6 Likes

I’ve gone ahead and cleaned up this topic and have added the current best options for solving the questions in the OP. If there’s anything missing or if you notice and issues, please feel free to respond.

:warning: Take backup before you make major bulk changes just in case…

Bulk tag/move topics through the UI:

For small categories, or subsets of topics, the bulk selection tool may be enough (see note at the end of this posts on notifications).

Move all topics from one category to another

First enter your site’s container:

cd /var/discourse
./launcher enter app

Bulk Tag All Topics Within a Category:

First enter your site’s container:

cd /var/discourse
./launcher enter app

I’m not 100% sure what types of notifications if any these methods trigger, but if you are concerned and want to be absolutely sure that notifications aren’t sent out, I would recommend checking the following settings while working on this:

  • disable_category_edit_notifications
  • disable_tags_edit_notifications
5 Likes