I couldn’t get this to work, but I was able to import the data with:
mongoexport
- change user ids and roomids in the messages from the old ids to the new ones (
sed 's/$OLD_ID/$NEW_ID/g'
) - changing
{ts: {$date: "2021-01-01T00:00:00.000Z"}}
to{ts: ISODate("2021-01-01T00:00:00.000Z")}
- adding
db.rockechat_message.import([
to top of the file - Running
load("/snap/rocketchat-server/msgs.js")
from the mongo console
without step 3 the data would load but the messages wouldn’t appear in the timeline.