0

Some time ago I set up a nodebb-forum with https://github.com/rez0n/docker-nodebb, connecting to another docker-container running mongo. With this nodebb-docker-container the uploaded files are stored persistant into the database. Now I want to move to the official nodebb docker image and want to have the files stored into the file system as usual.

How can I export the already stored files in the collection into nodebb/public/uploads on the file system to follow the advices in https://docs.nodebb.org/configuring/upgrade/? The files are in different file types (pdf, jpg etc.) from different users, in different posts.

Here are the collections:

objects
searchpost
searchtopic
sessions

and the dump:

objects.bson - 14M
objects.metadata.json - 603
searchpost.bson - 5.4M
searchpost.metadata.json - 487
searchtopic.bson - 80K
searchtopic.metadata.json - 488
sessions.bson - 22K
sessions.metadata.json - 296

If I for example query the objects for a specific file, I get:

nodebb> db.objects.find( { value : "files/1619903042459-fostering-lifelong-learning-and-vocational-training-in-the-agricultural-and-forestry-sectors.pdf" })
[
  {
    _id: ObjectId("647c86b0d6850eecb6b80970"),
    _key: 'uid:1:uploads',
    value: 'files/1619903042459-fostering-lifelong-learning-and-vocational-training-in-the-agricultural-and-forestry-sectors.pdf',
    score: 1619903042501
  },
  {
    _id: ObjectId("647c86b0d6850eecb6b80b08"),
    _key: 'post:26:uploads',
    value: 'files/1619903042459-fostering-lifelong-learning-and-vocational-training-in-the-agricultural-and-forestry-sectors.pdf',
    score: 1619903729826
  }
]

...and I am not shure if behind any of these two objects is the file I finally want to get!

Any help is appreciated, just point me to the right way :-)

Jochen Haßfurter
  • 875
  • 2
  • 13
  • 27

0 Answers0