@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.