Updating/Upgrading MongoDB (Docker)

Description

I’m trying to update MongoDB, but I have no clue how to. Even after seeing the information page from Rocket Chat on this, I’m still clueless on how to do this.

Server Setup Information

  • Version of Rocket.Chat Server:
  • Operating System: Alpine Linux
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: I don’t know what this is
  • NodeJS Version: v12.22.1
  • MongoDB Version: 4.0.27
  • Proxy: nginx
  • Firewalls involved:

Hi! What version of Rocket.Chat are you using?

Updating MongoDB would require some technical knowledge.
Also, you should backup before doing it.

as you are using docker, things might be easier.

Oops, I forgot to add the version. It is 4.0.3.
I have some experience, but I’m not sure how to do this.

Ok, so you are probably worried about the deprecation warning that appeared after migrating to version 4.0.3

can you confirm you are using the official docker-compose file?

Also, can you confirm you already read this instructions about this subject?

those instructions will guide you to, in summary:

  • do a backup
  • copy the migrator dockerfile
  • change the docker-compose to include the migrator
  • run everything and migrate from mmap to wiredtiger storage engine

Let me know if that helps.

Yes, I see the warning you mentioned on my installation.

I get this warning even after freshly installing Rocket Chat with the official docker-compose file from the Docker installation guide. Should this be happening even on a fresh installation? Maybe I could have used the wrong one?

I don’t seem to be able to find the instruction page you forwarded on the Docker installation page. I don’t know how I would have found it without your helping me, as I can’t find it in the documentation.

To confirm, your recommendation is to follow your instruction page?

Thank you.

Is your installation a fresh one?

If that’s the case, you can start everything already with mongo 4.4

We are working to update the docker-compose to use mongo 4.4, but you can easily tweak it to start with mongo 4.4 already.

OK, I see… I simply need to change the mongo:4.0 image with mongo:4.4 in the docker-compose file when starting a new instalation then?

You’ll need to change the command instruction

before:

command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1

after

command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger

basically, removing the --smallfiles and changing the storageEnigine

also, don’t forget to change the init-replica service to 4.4 too

That has cleared up the error messages, thank you so much.
The “rocket-chat_mongo-init-replica_1 container” is always stopped, is this expected?

yes!

it’s main goal is to run only at the first run, and create the replicaset at mongo db accordingly.

Thank you for your help, my team now love Rocket.Chat.

1 Like

Can this container be removed after it does its first run?

you can!

It quits on the first run, even when you restart the whole stack.

So it doesn’t consume any resources.