Bulk change categories without logging edit

(Joshua Rosenfeld) #1

Long story short: the Discourse I’m currently working on is quite old. Further, it was primarily run by people who did not understand Discourse, and so many things were deleted, unlisted, moved, etc. that shouldn’t have been, and are now causing complications.

I want to “fix” the broken categories - mostly those with deleted/unpinned description topics. I’m looking to do the following:

  1. Rename broken category.
  2. Create a new category.
  3. Recategorize all topics from broken category to new category.
  4. Delete broken category.
  5. Repeat until all broken categories are deleted.

Which leads me to:

  1. Can I bulk recategorize topics without causing it to be logged? I don’t want most topics on the site to have an edit, nor do I have time to hide the revision for 1,000+ topics.
  2. Is there a better way to fix old “broken” categories?

(Sam Saffron) #2

There have been some discussion about “non bumping” edits, I am totally unsure about how to introduce this without adding noise.

I guess one option would be to add a site setting for “don’t bump for bulk actions”, then you would enable it temporarily, make your changes and then disable.

If you need to do this today you can do it from the console. If this is for stonehearth we can help out.

(Joshua Rosenfeld) #3

I like this idea. Sort of like the way restore works now.

Not Stonehearth, a self-hosted internal site for my company. Mind sharing the rails commands?

Edit: Found this, can you confirm Sam that this is still accurate/safe? It looks like @tobiaseigen had some issues (incorrect category counts and “about this” topics moving). Also, for the category IDs is it best to get them from site.json, or is there an easier way?:

Edit 2: Looks like the admin wrench change category button does not log edits - none of the categories have a large number of topics, so I can use the Select All button to handle this. (I don’t have console access on this site anyway, would have needed to bother IT - so this UI method is certainly preferred.)