Import data into Snap installation from mongodump

I couldn’t get this to work, but I was able to import the data with:

  1. mongoexport
  2. change user ids and roomids in the messages from the old ids to the new ones (sed 's/$OLD_ID/$NEW_ID/g')
  3. changing {ts: {$date: "2021-01-01T00:00:00.000Z"}} to {ts: ISODate("2021-01-01T00:00:00.000Z")}
  4. adding db.rockechat_message.import([ to top of the file
  5. 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.