How can I setup NodeBB with MongoDB Atlas Cloud?
-
Hello,
I'm using MongoDB Atlas on the cloud. I'm trying to run nodebb setup with the URI to connect, but it keeps removing the URI from the config.json and replacing it with the default host info. I need to initialize the MongoDB Atlas database with the correct objects somehow. I've been trying to set the URI and running nodebb setup, but if there is some other way I can initialize my MongoDB atlas instance with the correct objects, that would help too.Can someone advise me on how to do this?
Thank you.
-
What provider? Make sure that the updated
config.json
is checked into git if it's Heroku or similar. -
@pitaj I"m eventually using IBM Bluemix, but I'm just using Nodebb locally initially for development. MongoDB Atlas is the cloud database as a service I'm using.
What do you mean "Make sure that the updated config.json is checked into git if it's Heroku or similar." I am unfamiliar with git and how it works. How does the nodebb setup read from git?
-
If you're using it locally, you're not on Heroku or similar. Heroku is a cloud container provider, and they use a git repository as the way to deploy your site.
What
config.json
are you using before running./nodebb setup
? -
I'm modifying the config.json at the NodeBB folder level.
Changing it from:
"mongo": { "host": "host", "port": 27017, "username": "user", "password": "password", "database": "nodebb" }
to something like:
"mongo": { "uri": "Mongoatlas URI connection" }
If I change it after nodebb setup, it connects to the Mongodb Atlas cloud correctly. However the objects in the database are not properly setup\initialized.
So I need to run nodebb setup against the Mongodb Atlas server, but the setup keeps overwriting\using config.json defaults. -
Have you tried setting up a
config.json
file before running./nodebb setup
? I'm thinking something like this:- Create
config.json
with the mongo uri setting
{ "database": "mongo", "mongo": { "uri": "...." } }
./nodebb setup
- Create
-
I think your only other option is to take a dump of the database on your local machine and push it onto the remote database.