@baris I am still unable to do the upgrade.. the mongo connection goes down after several minutes running the update:
nodebb | Parsing upgrade scripts...
nodebb | OK | 5 script(s) found, 124 skipped
nodebb | → [2023/7/2] Update chat messages to add roomId field...
nodebb | Error occurred
[### ] (502/1775) 28% 2023-08-19T18:27:29.351Z [4567/10] - warn: NodeBB Setup Aborted.
nodebb | MongoServerError: cursor id 8839582387884439579 not found
nodebb | at Connection.onMessage (/usr/src/app/nodebb/node_modules/mongodb/lib/cmap/connection.js:202:26)
nodebb | at MessageStream.<anonymous> (/usr/src/app/nodebb/node_modules/mongodb/lib/cmap/connection.js:61:60)
nodebb | at MessageStream.emit (node:events:513:28)
nodebb | at processIncomingData (/usr/src/app/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:124:16)
nodebb | at MessageStream._write (/usr/src/app/nodebb/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
nodebb | at writeOrBuffer (node:internal/streams/writable:392:12)
nodebb | at _write (node:internal/streams/writable:333:10)
nodebb | at Writable.write (node:internal/streams/writable:337:10)
nodebb | at Socket.ondata (node:internal/streams/readable:766:22)
nodebb | at Socket.emit (node:events:513:28)
nodebb exited with code 1
I guess my only option is to remove chat messages. Is there any tool for this or am I gonna have to figure it out in the DB ? Can I just run a delete on {_key:"message:*"}
where the timestamp is older than 1 month or something ?
If I run this, would i break something ?
db.objects.deleteMany({
"_key": {
"$regex": /^message:\d+$/
},
"timestamp": { "$lt": oneMonthAgoTimestamp }
});