# The Ultimate Guide: Upgrading RocketChat Deployed in Docker and Upgrading MongoDB

**URL:** <https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886>\
**Category:** Community Support\
**Created:** [April 17, 2022, 2:09am UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886 "2022-04-17T02:09:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vmsman](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/vmsman/32/3145_2.png) [@vmsman](https://forums.rocket.chat/u/vmsman)\
**Post date:** [April 17, 2022, 2:09am UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/1 "2022-04-17T02:09:27Z")

</div>

After much work, I developed a simple guide to upgrade Docker deployed RocketChat.  
I have a step by step guide to upgrade MongoDB from 4.x to 5.0 and get rid of the dreaded deprecated messages.

> **[Upgrading RocketChat Deployed in Docker](https://discussion.scottibyte.com/t/upgrading-rocketchat-deployed-in-docker/69)**
>
> This is a guide to upgrading RocketChat deployed in Docker. RocketChat can be easily upgraded by updating the “RocketChat” container version in your docker-compose.yml file. Once you have updated the version: docker pull...

---

<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:** [April 18, 2022, 12:51pm UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/2 "2022-04-18T12:51:51Z")

</div>

That’s really nice.

Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![vmsman](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/vmsman/32/3145_2.png) [@vmsman](https://forums.rocket.chat/u/vmsman)\
**Post date:** [April 18, 2022, 3:39pm UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/3 "2022-04-18T15:39:39Z")

</div>

Thanks for the kudo. I needed to de-mystify this process. I had two buddies that kept asking if I could make this easier. I read several posts where folks were installing new RocketChat and getting Mongo 4.0 with mmap which immediately was marked deprecated. Hopefully this will guide them step by step through the upgrade process prior to RocketChat v5.0.

---

<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:** [April 24, 2022, 5:39am UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/4 "2022-04-24T05:39:52Z")

</div>

Nice, thanks! Could you consider making a guide on moving a Rocket.Chat instance to another server? I feel like this and updating the database are the two most confusing issues.

---

<div class="post-metadata">

**Author:** ![vmsman](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/vmsman/32/3145_2.png) [@vmsman](https://forums.rocket.chat/u/vmsman)\
**Post date:** [April 24, 2022, 6:40am UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/5 "2022-04-24T06:40:16Z")

</div>

@steve5050 In the first part of this video you will notice where I had my instance loaded in /home/scott and I moved it to /opt/rocketchat which was a prerequisite to performing the database upgrade. The first part of the upgrade also does a dump of the database.

Knowing those two things, moving RocketChat to another server is easy. My Rocketchat guide is designed for RocketChat deployed in Docker and that makes it very “movable”.

In my case, my server instance is a LXD container and so the docker is nested inside that container. I have another video on installing RocketChat and also several videos that address LXD containers. Overall, I think all the pieces to the puzzle for pulling off a move are here. If not, perhaps we can chat sometime. Say hi on my RocketChat server at [https://chat.scottibyte.com](https://chat.scottibyte.com).

---

<div class="post-metadata">

**Author:** ![vmsman](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/vmsman/32/3145_2.png) [@vmsman](https://forums.rocket.chat/u/vmsman)\
**Post date:** [April 24, 2022, 6:44am UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/6 "2022-04-24T06:44:31Z")

</div>

Oh, and you are so right about how confusing the mongodb update was. I battled it for a few months and decided it needed to be a video after all my grief.

---

<div class="post-metadata">

**Author:** ![vawaver](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/vawaver/32/3786_2.png) [@vawaver](https://forums.rocket.chat/u/vawaver)\
**Post date:** [May 29, 2022, 2:38pm UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/7 "2022-05-29T14:38:06Z")

</div>

Thank you for sharing the tutorial.  
My actual state is:  
±---------------------------------------------------+  
| SERVER RUNNING |  
±---------------------------------------------------+  
| |  
| Rocket.Chat Version: 4.7.2 |  
| NodeJS Version: 14.18.3 - x64 |  
| MongoDB Version: 4.2.20 |  
| MongoDB Engine: wiredTiger |  
| Platform: linux |  
| Process Port: 3000 |  
| Site URL: [https://myweb.com](https://myweb.com) |  
| ReplicaSet OpLog: Enabled |  
| Commit Hash: 1688633945 |  
| Commit Branch: HEAD |  
| |

But I have a problem to upgrade Mongo 4.2 → 4.4  
I edited my docker-compose.yml file to image mongo:4.4 and create a new mongo container…  
But it is impossible to connect to docker container via command

docker exec -it rocketchat\_mongo\_1 bash  
Error response from daemon: Container 01881fe3bf53af4c72181d88a871cd03b6947e02eaee76e378e9b30631c3f04e is restarting, wait until the container is running

I checked rocketchat\_rocketchat\_1

```auto
/app/bundle/programs/server/node_modules/fibers/future.js:313
						throw(ex);
						^
MongoServerSelectionError: getaddrinfo EAI_AGAIN mongo
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {
  reason: TopologyDescription {
    type: 'Single',
    setName: null,
    maxSetVersion: null,
    maxElectionId: null,
    servers: Map(1) {
      'mongo:27017' => ServerDescription {
        address: 'mongo:27017',
        error: Error: getaddrinfo EAI_AGAIN mongo
            at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:71:26) {
          name: 'MongoNetworkError'
        },
        roundTripTime: -1,
        lastUpdateTime: 720770100,
        lastWriteDate: null,
        opTime: null,
        type: 'Unknown',
        topologyVersion: undefined,
        minWireVersion: 0,
        maxWireVersion: 0,
        hosts: [],
        passives: [],
        arbiters: [],
        tags: []
      }
    },
    stale: false,
    compatible: true,
    compatibilityError: null,
    logicalSessionTimeoutMinutes: null,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    commonWireVersion: null
  }
}
Tried 1 times. Waiting 5 secs...

```

What should I do?

---

<div class="post-metadata">

**Author:** ![vmsman](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/vmsman/32/3145_2.png) [@vmsman](https://forums.rocket.chat/u/vmsman)\
**Post date:** [May 29, 2022, 3:15pm UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/8 "2022-05-29T15:15:17Z")

</div>

@vawaver Tony, Go watch my video to see the steps. [Upgrading RocketChat in Docker - MongoDB 4 0 x Deprecated - YouTube](https://www.youtube.com/watch?v=fsBcCiG1AGk) The restarting issue is normally caused by not having the Docker-compose file that I mentioned configured exactly as I describe.

---

<div class="post-metadata">

**Author:** ![vawaver](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/vawaver/32/3786_2.png) [@vawaver](https://forums.rocket.chat/u/vawaver)\
**Post date:** [May 29, 2022, 6:34pm UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/9 "2022-05-29T18:34:54Z")

</div>

@vmsman  
Thank you very much for your reply.  
I successfully had made the Mongo upgrades from 4.0-\>4.2.-\>4.4  
But when I tried to make an upgrade 4.4-\>5.0 there is some problem I cannot identify.  
I used the same steps as you showed in your tutorial.  
After pulling down of 5.0 image mongo container is created.

```auto
docker exec -it rocketchat_mongo_1 bash
Error response from daemon: Container b7e0aecfbaa3d3b53ce467328c89a130a8a84ebf7d9a8dbeb8ba8be076d09f0e is restarting, wait until the container is running

```

rocketchat\_rocketchat\_1 - log

```auto
Errors like this can cause oplog processing errors.
Setting EXIT_UNHANDLEDPROMISEREJECTION will cause the process to exit allowing your service to automatically restart the process
Future node.js versions will automatically exit the process
=================================
Exception in setInterval callback: MongoServerSelectionError: getaddrinfo EAI_AGAIN mongo
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {
  reason: TopologyDescription {
    type: 'Single',
    setName: null,
    maxSetVersion: null,
    maxElectionId: null,
    servers: Map(1) { 'mongo:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    compatibilityError: null,
    logicalSessionTimeoutMinutes: null,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    commonWireVersion: 9
  }
}
{"level":50,"time":"2022-05-29T18:33:17.420Z","pid":7,"hostname":"3a92412c3ca2","name":"LivechatEnterprise","section":"Queue","msg":"Error processing queue public","err":{"type":"MongoServerSelectionError","message":"getaddrinfo EAI_AGAIN mongo","stack":"MongoServerSelectionError: getaddrinfo EAI_AGAIN mongo\n at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)\n at listOnTimeout (internal/timers.js:557:17)\n at processTimers (internal/timers.js:500:7)\n => awaited here:\n at Function.Promise.await (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)\n at app/models/server/raw/OmnichannelQueue.ts:44:15\n at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40\n => awaited here:\n at Function.Promise.await (/app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)\n at ee/app/livechat-enterprise/server/lib/LivechatEnterprise.js:269:4\n at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40","name":"MongoServerSelectionError","reason":{"type":"Single","setName":null,"maxSetVersion":null,"maxElectionId":null,"servers":{},"stale":false,"compatible":true,"compatibilityError":null,"logicalSessionTimeoutMinutes":null,"heartbeatFrequencyMS":10000,"localThresholdMS":15,"commonWireVersion":9}},"msg":"getaddrinfo EAI_AGAIN mongo"}
Exception in setInterval callback: MongoServerSelectionError: getaddrinfo EAI_AGAIN mongo
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {
  reason: TopologyDescription {
    type: 'Single',
    setName: null,
    maxSetVersion: null,
    maxElectionId: null,
    servers: Map(1) { 'mongo:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    compatibilityError: null,
    logicalSessionTimeoutMinutes: null,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    commonWireVersion: 9
  }
}
Exception in setInterval callback: MongoServerSelectionError: connect ECONNREFUSED 192.168.192.2:27017
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {
  reason: TopologyDescription {
    type: 'Single',
    setName: null,
    maxSetVersion: null,
    maxElectionId: null,
    servers: Map(1) { 'mongo:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    compatibilityError: null,
    logicalSessionTimeoutMinutes: null,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    commonWireVersion: 9
  }
}
Exception in setInterval callback: MongoServerSelectionError: connect ECONNREFUSED 192.168.192.2:27017
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {
  reason: TopologyDescription {
    type: 'Single',
    setName: null,
    maxSetVersion: null,
    maxElectionId: null,
    servers: Map(1) { 'mongo:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    compatibilityError: null,
    logicalSessionTimeoutMinutes: null,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    commonWireVersion: 9
  }
}
Exception in setInterval callback: MongoServerSelectionError: connect ECONNREFUSED 192.168.192.2:27017
    at Timeout._onTimeout (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7) {
  reason: TopologyDescription {
    type: 'Single',
    setName: null,
    maxSetVersion: null,
    maxElectionId: null,
    servers: Map(1) { 'mongo:27017' => [ServerDescription] },
    stale: false,
    compatible: true,
    compatibilityError: null,
    logicalSessionTimeoutMinutes: null,
    heartbeatFrequencyMS: 10000,
    localThresholdMS: 15,
    commonWireVersion: 9
  }
}

```

So I do not know how to move forward.

---

<div class="post-metadata">

**Author:** ![vawaver](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/vawaver/32/3786_2.png) [@vawaver](https://forums.rocket.chat/u/vawaver)\
**Post date:** [May 29, 2022, 6:47pm UTC](https://forums.rocket.chat/t/the-ultimate-guide-upgrading-rocketchat-deployed-in-docker-and-upgrading-mongodb/13886/10 "2022-05-29T18:47:16Z")

</div>

I found another problem with compatibility of my CPU

```auto
WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
  see https://jira.mongodb.org/browse/SERVER-54407
  see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
  see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814

```
