# Updating/Upgrading MongoDB (Docker)

**URL:** <https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568>\
**Category:** Community Support\
**Created:** [November 10, 2021, 9:45am UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568 "2021-11-10T09:45:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve5050](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@steve5050](https://forums.rocket.chat/u/steve5050)\
**Post date:** [November 10, 2021, 9:45am UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/1 "2021-11-10T09:45:54Z")

</div>

### 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:

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [November 10, 2021, 10:48am UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/2 "2021-11-10T10:48:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![steve5050](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@steve5050](https://forums.rocket.chat/u/steve5050)\
**Post date:** [November 10, 2021, 1:48pm UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/3 "2021-11-10T13:48:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [November 10, 2021, 6:50pm UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/4 "2021-11-10T18:50:45Z")

</div>

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?

> **[MongoDB mmap to wiredTiger migration](https://docs.rocket.chat/quick-start/installing-and-updating/docker-containers/mongodb-mmap-to-wiredtiger-migration)**
>
> Migrate your existing mmap based MongoDB instance into a wiredTiger one without with as little downtime as possible.

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.

---

<div class="post-metadata">

**Author:** ![steve5050](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@steve5050](https://forums.rocket.chat/u/steve5050)\
**Post date:** [November 10, 2021, 7:37pm UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/5 "2021-11-10T19:37:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [November 10, 2021, 7:39pm UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/6 "2021-11-10T19:39:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![steve5050](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@steve5050](https://forums.rocket.chat/u/steve5050)\
**Post date:** [November 10, 2021, 7:51pm UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/7 "2021-11-10T19:51:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [November 10, 2021, 7:56pm UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/8 "2021-11-10T19:56:13Z")

</div>

You’ll need to change the command instruction

before:

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

```

after

```auto
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

---

<div class="post-metadata">

**Author:** ![steve5050](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@steve5050](https://forums.rocket.chat/u/steve5050)\
**Post date:** [November 11, 2021, 7:37pm UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/9 "2021-11-11T19:37:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [November 12, 2021, 11:44am UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/10 "2021-11-12T11:44:14Z")

</div>

yes!

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

---

<div class="post-metadata">

**Author:** ![steve5050](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@steve5050](https://forums.rocket.chat/u/steve5050)\
**Post date:** [November 12, 2021, 11:51am UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/11 "2021-11-12T11:51:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![steve5050](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@steve5050](https://forums.rocket.chat/u/steve5050)\
**Post date:** [February 20, 2022, 6:24pm UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/12 "2022-02-20T18:24:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dudanogueira](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/dudanogueira/32/2529_2.png) [@dudanogueira](https://forums.rocket.chat/u/dudanogueira)\
**Post date:** [February 21, 2022, 1:18pm UTC](https://forums.rocket.chat/t/updating-upgrading-mongodb-docker/12568/13 "2022-02-21T13:18:08Z")

</div>

you can!

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

So it doesn’t consume any resources.
