I think a script like this could work:
'use strict';
var nconf = require('nconf');
var async = require('async');
nconf.file({
file: 'config.json',
});
nconf.defaults({
base_dir: __dirname,
views_dir: './build/public/templates',
});
var db = require('./src/database');
async.series([
db.init,
process,
], (err) => {
if (err) {
console.error(err);
process.exit(1);
}
process.exit();
});
const freq = 'off'; // or daily, weekly, monthly
function process(callback) {
var batch = require('./src/batch');
var User = require('./src/user');
batch.processSortedSet('users:joindate', function (uids, next) {
async.parallel([
cb => async.each(uids, (uid, next) => {
User.setSetting(uid, 'dailyDigestFreq', freq, next);
}, cb),
cb => async.each(uids, (uid, next) => {
User.updateDigestSetting(uid, freq, next);
}, cb),
], next);
}, callback);
}
I think this should work to set all users to a specific frequency. Please backup your database before trying this. You might also need to fix a couple JS errors, I haven't tried this myself.
Create a new file called process-users.js in your main nodebb directory (the one with config.json etc), paste that script into it, set the frequency you desire, and run node process-users from within that directory to set all of your users to the selected frequency.