Pre-Seeded Site Feedback Category - Allow Modifying Security Rules

@sunjam Here is a solution: Bulk move many topics from one category to another

I just tested it now on a test instance and it worked fine, was only with a small amount of topics though.

So SSH into your server then use these commands (in this example, all topics in category 2 will be moved to category 1, so replace those numbers as needed):

cd /var/discourse
./launcher enter app
rails c
Topic.where(category_id: 2).update_all(category_id: 1)

You can get the category ids from the numbers at the end of your category urls.

Edit: Only issue is it will also move the ‘about this category’ post as well and it doesn’t seem possible to move it back or delete it from the admin UI. Can make it unlisted but not sure if that would cause issues. Give me a moment, will update shortly.

Edit 2: So to move the ‘about this category’ topic back to the correct category. Just use this command (where the topic id is 1 and the desired category to move it to is 2). Tested it now and it worked:

Topic.where(id: 1).update_all(category_id: 2)

You can get the topic id from the end of the topic url just like the category ids.

3 Likes