Magie asked if it’s possible to change the category linked to a chat channel via the Rails console, since this isn’t supported in the UI. In post 2, they shared a working solution: access the server, enter the Discourse container, open the Rails console, find the chat channel by its slug (e.g., cat-pictures), identify its current chatable_id (the linked category’s ID), then update it to the desired category’s ID (e.g., 9) and save. They caution that this requires server access and Rails knowledge, and warn of potential risks when modifying live databases. The method was tested successfully and may help others facing the same limitation, as referenced in this meta thread.
Update:
I figured out my solution and sharing it here since it might help somebody.
Disclaimer:
You need access to your server and it helps if you understand what you’re doing. If not, I recommend getting help from somebody who knows servers and Ruby on Rails.
Also be mindful: Changing data in a running database could cause problems.
Steps:
First access your server. Once you’re there become a root user. Navigate to the Discourse container and enter it:
cd /var/discourse
./launcher enter app
Once inside the container open the Rails console:
rails c
Now in your browser find the chat channel slug. You can find it inside the URL e.g. when you open the chat channel in full screen mode: https://my-example-forum.com/chat/c/cat-pictures/17
In the Rails console get the chat channel object you want and save it in a variable:
If now you just type the variable chat and hit enter you can see the object and all its attributes. One of it is chatable_id. There you can see the ID of the category the chat channel is linked to. The chatable_id could be set to 5 for example.
We can change this chatable_id to the ID of the category you want the chat channel to correspond to. You can find this ID in the URL of the category in the browser: https://my-example-forum.com/c/cats/9
Now that you know the desired category ID you can adjust the category linked to the chat channel: