How do I move all the posts from one category to a different category?
Bulk move many topics from one category to another
Move all articles from 1 category to other and tagging
A question of curiosity @sam… why can’t you change categories at the page level? I’m sure there’s a reason, but it just seems odd if you’re viewing the post [at URL/t/post-title] that you have to navigate away from it to change the category.
No you don’t. Scroll to the top and click the Edit Pencil next to the topic title.
Just tried to do this on a category with a few thousand threads… Chrome crashed.
I’m not surprised. A few thousand topics is quite a lot to change at once. I’d suggest doing it in batches - say 100-200 at a time.
I ended up doing it in the console and it happened almost instantly. Thanks Joshua
If anyone wants to do something similar… Here’s moving a bunch of subcategory topics to a top level category:
category = Category.find_by(name:'Category Name') category.subcategories.each do |subcategory| Topic.where(category_id: subcategory.id).update_all(category_id: category.id) subcategory.update(topic_count: Topic.where(category_id: subcategory.id).count) end
Move all topics subcategorys to main category
Hello, how i run this script?