Change room type from "Discussion" to "Private Group"

I’m wondering if it’s possible to “convert” a room from discussion to private group?

When using REST API to get room information, I can see that room type is p for both discussion and private group. The only difference being that a discussion have an attribute prid (I guess for Parent Room ID) that the private group doesn’t have.

So I was guessing that maybe dropping this prid information from database my do what I want. But honestly I was looking first to something that is less of an hack such as using API to update room settings (but didn’t find any API covering such use case).

Any help would greatly appreciated.

I manage to transform a room from “Discussion” to “Private Group” by doing the following:

  • Rung MongoDB shell
  • Select Rocket.Chat database: use rocketchat
  • Get a list of “Discussion” rooms: db.rocketchat_room.find({"prid":{ $exists: true }}).pretty()
  • Remove prid attribute of a “Discussion” room (adjust the _id value): db.rocketchat_room.update({"_id" : "abZrsHnfpAfNp8h9hR"}, {$unset: {prid : "" }})
  • This is it for the server side

In order to refresh the view on the client side currently the only solution I found is for the user to leave the “Discussion” and then be added back to the “Private Group”.

1 Like

You save my day!
I have a discussion on my server with 90 participants and over 3000 messages. And most interesting thing - that discussion was created from DM of 2 users, both are fired long time ago and their user accounts are deleted on server.
On recent 4.6.3 version all members of that discussion start getting error The requested "roomId" of "roomName" param provided does not match any channel [error-room-not-found]
image

So, I deleted prid of discussion document in MongoDB. Guess now every user of that discussion have to re-join.