Remove attachments from RocketChat database


#1

Hello everyone.
Duplicate my post from GitHub here.
I have RocketChat 0.71.1
Located on console.cloud.google.com. The installation done from the docker and controlled by kubernates.
The database is mongo v4.0.4.
For a long time the type of storage was GridFS (save to database) for downloading files. Now the download type has changed to Google Cloud Storage.
How can I correctly remove attachments from the Mongo database and RocketChat does not break down?
I find 6 collections about attachments in DB:
dbname_uploads
dbname_uploads.chunks
dbname_uploads.files
dbname_userDataFiles.chunks
dbname_userDataFiles.files
dbname_user_data_files
But don know what to do with this. Searched everywhere but nowhere is there a solution.
If you know, tell me please how to solve this problem.


#2

The actual files would be in the uploads.chunks and uploads.files.

Note removing will likely lead to them just not able to load in Rocket.Chat. Removing beyond that is a bit more complicated.