Changes

From SME Server
Jump to navigationJump to search
656 bytes added ,  17:37, 1 November 2021
no edit summary
Line 144: Line 144:  
  replication:
 
  replication:
 
   replSetName: rs0
 
   replSetName: rs0
 +
 +
 +
Once started you need to initialises the replicaset:
 +
 +
mongo --eval "printjson(rs.initiate())"
 +
 +
===Dump and restore===
 +
 +
Samples - YMMV.
 +
 +
Quick little script to dump the Rocket.Chat collection:
 +
 +
#!bin/bash
 +
echo "Dump with Users/Roles"
 +
mongodump --dumpDbUsersAndRoles -d rocketchat -o /root/backup/rocketchatmongo
 +
echo "dump all"
 +
mongodump -d rocketchat -o /root/backup/rocketchatmongo-all
 +
 +
 +
And to restore:
 +
 +
mongorestore /root/backup/rocketchatmongo-all
 +
 +
Do not restore between versions.
 +
 +
If you export from a version eg 4.0 then restore to that version. Do not try and restore 4.0 to 4.2 or higher.
 +
 +
Then change your repo, and then upgrade mongo.
 +
    
===Vaporise or reinitialise the database===
 
===Vaporise or reinitialise the database===

Navigation menu