@oplik0 yeah and if you don't want an upgrade script and just want to run some code that connects to the database to modify stuff or create reports etc. you can run custom script. These go in the nodebb folder and can be executed by node my_custom_script.js. Below is a template that we use frequently.
/* globals require, console, process */
'use strict';
const nconf = require('nconf');
nconf.file({
file: 'config.json',
});
nconf.defaults({
base_dir: __dirname,
views_dir: './build/public/templates',
upload_path: 'public/uploads',
});
const db = require('./src/database');
db.init(async (err) => {
if (err) {
console.log(`NodeBB could not connect to your database. Error: ${err.message}`);
process.exit();
}
await doSomethingUseful();
console.log('done');
process.exit();
});
async function doSomethingUseful() {
console.log('global object', await db.getObject('global'));
}