Set up nodebb development instance
-
@dave1904 I wouldn't use
sudo shutdown -h now
as you might as well just press the power button and this can cause your running MongoDB instance unnecessary damage.It would be cleaner to stop NodeBB first so the database is disconnected, take a backup of both the MongoDB database, and a copy of the NodeBB directory, then restart NodeBB on the production instance.
You can then use the file copy and the database to overwrite a vanilla installation - obviously change the
config.json
file to ensure you're not pointing to the production database etc.Happy to help with this, and I've written some guides already around setting up the Dev environment and database recovery, plus some commands to run in terms of clearing the cookie domain which can lend itself well to the inability to login post recovery.
-
@phenomlab That's news to me... I thought
shutdown
was a graceful way to turn off the computer. Hell, I have a cronjob that runs that every morning at 2am on my home theater PC 🥴shutdown
in my limited knowledge should execute the appropriate systemctl hooks to shut down NodeBB...Even if you run NodeBB using
./nodebb start
,shutdown
should just callkill -15 <nodebb pid>
, which NodeBB listens for and terminates connections gracefully. -
@julian said in Set up nodebb development instance:
shutdown in my limited knowledge should execute the appropriate systemctl hooks to shut down NodeBB...
it should, yes, but I've seen various instances of this where dependencies have failed to stop in time and
systemctl
proceeds anyway. I would always approach this with caution. The mileage may also vary depending on the flavour of Linux in use. -
Thank you @phenomlab! So if I need to shut down the droplet, first shutdown nodebb and take backups. Then
sudo shutdown -h now
should be ok?@phenomlab said in Set up nodebb development instance:
You can then use the file copy and the database to overwrite a vanilla installation
Does that mean I should install a new instance first? And then overwrite all files with the copied folder? My thought was to just edit
config.json
of the copied folder and then start nodebb.edit: and one more question as this is related to this topic: How does your development enviroment look like guys? Currently I'm using Filezilla with Sublime Text to edit files, it's not so much fun.
-
@dave1904 said in Set up nodebb development instance:
Does that mean I should install a new instance first? And then overwrite all files with the copied folder? My thought was to just edit config.json of the copied folder and then start nodebb.
That's generally how I do it. Otherwise, you'll land up with the recovered database looking for plugins that aren't there, and they will need to be installed anyway. Obviously, don't override
config.json
as this has already been setup and then you'd be replacing it with the live version which you want to avoid. -
@dave1904 said in Set up nodebb development instance:
How does your development enviroment look like guys? Currently I'm using Filezilla with Sublime Text to edit files, it's not so much fun
Are you using Windows or Linux? If Windows, I'd recommend BitVise which is free and a superb tool.
-
@phenomlab said in Set up nodebb development instance:
@dave1904 said in Set up nodebb development instance:
How does your development enviroment look like guys? Currently I'm using Filezilla with Sublime Text to edit files, it's not so much fun
Are you using Windows or Linux? If Windows, I'd recommend BitVise which is free and a superb tool.
I'm using Manjaro. I thought of something like having ftp access integrated and synced within an IDE. Maybe I can do this in Code OSS. Thanks
-
@phenomlab said in Set up nodebb development instance:
@dave1904 yes, probably. Direct access is generally better otherwise you have to keep uploading changes which is clunky. I'd typically use an IDE that allows direct connection so you can avoid this.
Which IDE are you using?
-
@dave1904 I typically use VSCode these days. Does what I want in the sense that it has decent syntax checking, plus a wealth of plugins etc. Its also cross platform so I can switch between windows and Linux easily.