Upgrade Mongo4.4-5/6 on local install


I want to upgrade mongo from 4.4 to 5 to 6 and tried different ways, but none leads to success.
After the mongo update:

  1. apt upgrade mongo4->mongo5
  2. remove mongo 4 and install mongo 5

rocketchat won´t start anymore.
What is the best and preferred way to do this?

Server Setup Information

  • Version of Rocket.Chat Server: 6.0.0
  • Operating System: Debian 11
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: yes
  • NodeJS Version: 14.21.2
  • MongoDB Version: 4.4.17
  • Proxy:
  • Firewalls involved:

Hi, please refer to MongoDB’s official documentation for this.

This may help

Hi, did you forget re-initiate replica?
This is what I did:

  1. stop rocket.chat server
  2. backup mongo database
    mongodump —out mongodump001
  3. backup /etc/mongod.conf
  4. purge old pkgs
    sudo apt-get purge mongodb-org*
  5. delete old mongo files
    sudo rm -rf /var/lib/mongodb
  6. install mongodb 5.x
    remove old apt.source for 4.4
    add new apt.source for 5.0
    sudo apt-get update
    sudo apt-get install mongodb-org
  7. restore /etc/mongod.conf
  8. restart mongo and check running
    (if not, remove “fork: true” line)
  9. initiate rs01 replica
    mongo -eval “printjson(rs.initiate())”
  10. restore mongo database
    mongorestore mongodump001 —drop
  11. restart mongo
  12. start rocketchat server
  13. clear cookies for the server on browser
  14. connect to the server

I am not a mongo/rocketchat expert. So I am not sure if this is the best procedure.

Hi cawcaw,
somewhat later, but this saved my nerves.
many thanks, the rs.initiate was the solution…

1 Like