How to extract files from MongoDB and/or GridFS

Description

I cannot find a way to extract files that have been uploaded to the DB. I found the collection (rocketchat_uploads) and can find the entries here but do not know how to extract them.

Any advice?

Server Setup Information

  • Version of Rocket.Chat Server: 4.3.2
  • Operating System: Ubuntu 20.04
  • Deployment Method:Manual Deployment
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 12.22.1
  • MongoDB Version: 4.4.11
  • Proxy: nginx
  • Firewalls involved: none

Any additional Information

none.

You could use our migrator tool: GitHub - RocketChat/filestore-migrator

1 Like

I haven’t tried it yet but it seems like it would work. If not, ill have to learn MongoDB a bit better.

Hey @bradley.hilton , what am I doing wrong here? I built the filestore-migrator, and it looks like it runs successfully, processing over 3600 files, but at the end I find no files in the filesystem destination. I am mapping a volume, and the path exists and everything…I don’t see any errors…Here is my command:

docker run -v /home/ops/docker-persist/rocketchat/uploads:/uploads --network=rocketchat_default filestore-migrator:latest -databaseUrl=mongodb://mongo:27017/rocketchat -destinationType=fs -destinationUrl=/uploads

I’ll tag @aaron.ogle for this one, he’s the one who wrote it.