Hello team discourse,
Do we have command line in order to move all topics of 1 category to new tag?
Do we have command line move all topics of subcategory to parent category?
- Navigate to the category with the posts you’d like to change
- Toggle the bulk select tool (upper left hand column header)

- Click the Select All button

- Click the Bulk Action wrench that appears on the upper right hand side

- Click the button in the pop-up to make the appropriate change (Set Category or Append/Replace Tags)
Thank @wesochuck, i know this feauture but each my subcategory have more 1000 topics difficult to load and setup them, so i wanna setup only a comand line ssh to server. Thank everyone!
There are some other topics here with examples of rails commands to select a bunch of posts and do something to those posts. Since you don’t have an answer yet you might look for those.
I’ve been too busy to spend spare time on this one myself. If it’s worth money to you I could do this for you for $200 today or half that on Monday.
EDIT: Here’s a start:
Topic.where(category_id: CURRENT_ID).update_all(category_id: NEW_ID)
You’ll want to take a backup before doing that!
Thank you! i moved subcategory come back parent category success.
I wanna insert and update all topics have a keyword to a tag, i know a little console but not effect, can you fix console same:
Topic.where(“quận 1 dt”).update_all(tags=“quận-1”)
rake posts:update_tag[“quận 1 dt”,“quận-1”]
I wanna do this action by consale, because my discourse have thousand topic to replace. What console to do this feature? Thank you!
Sorry so much! Im not a developer and don’t follow rails console professional, i will try study more. Thank you so much!
Hello,
I run this comand but note effect, can you help me fix this command?
Topic.where(category_id: CURRENT_ID).update_all(tags: ‘quan-1’)
I run this command but not effect
UPDATE “topics” SET “tag” = ‘quan-1’ WHERE (“topics”.“deleted_at” IS NULL) AND “topics”.“category_id” = 2752
Can we insert or update tag for topic by below console?
UPDATE topics SET tag = ‘tag_content’ WHERE topics.category_id = Category_ID_wanna
Discourse에 질문합니다.
특정 문자열이 포함된 모든 주제에 태그를 할당할 수 있으며, 이를 위해 어떤 명령을 사용할 수 있나요?
예시:
UPDATE topics SET tag = ‘tag_content’ WHERE topics.content= "a string"
가능할까요? ![]()
네, 해당 작업을 수행하는 방법은 여기에서 확인할 수 있습니다: Administrative Bulk Operations.
좋은 기능이지만, 해당 카테고리의 기본 스레드(카테고리에 대한 정보가 포함된 스레드)는 이동되지 않는다는 점이 다소 이상하게 느껴졌습니다. 게다가 해당 주제를 실제로 이동할 방법을 전혀 찾을 수 없기도 합니다.
Discourse에서 카테고리를 생성하면 해당 카테고리를 위한 “소개(About)” 토픽이 자동으로 생성됩니다. 이 토픽은 이동할 수 없습니다. 대신, 카테고리 소개 토픽의 내용을 새 카테고리 소개 토픽으로 수동으로 복사할 수는 있습니다.
말씀하시는 내용은 이해하고 있고, 어느 정도 공감은 합니다. 하지만 왜 그런 결과가 나오는지 명확하지는 않아요. 이 토픽은 논쟁의 여지가 있지만 이동할 수 있을지도 모를 내용을 포함하고 있습니다. 모든 것을 새로운 카테고리로 옮기는 중인데, 해당 토픽들에는 유용한 내용이 있었기 때문에 나중에 카테고리의 중첩 제한을 알게 되면서 구조를 정리하는 중이에요.
단순히 피드백을 드리는 것이니 참고해 주세요.
감사합니다! 유용한 피드백입니다. Discourse 사용자 인터페이스에는 About 토픽을 이동할 수 없는 _이유_를 알려 주는 것이 표시되어 있지 않습니다.

