Upgrade Rocket.Chat 4.8.4 (Docker) to latest version

Description

Hello, we are using Rocket.Chat on Docker since version 2. Now we want to upgrade to the latest version of Rocket.Chat on Docker, but our docker-compose.yml is very different from the current config. How am i able to update to the latest version? Is there any kind of tutorial or how-to? I’ve already tried to use the upgrade guide (Updating Rocket.Chat - Rocket.Chat Docs), but it doesn’t work for my instance.

Server Setup Information

  • Version of Rocket.Chat Server: 4.8.4
  • Operating System: Debian 9
  • Deployment Method: Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: -
  • NodeJS Version: v13.14.0
  • MongoDB Version: 5.0
  • Proxy: Nginx
  • Firewalls involved: UFW

Any additional Information

Here is my docker-compose.yml file which i’m using since the beginning of our instance.

version: '2'

services:
  rocketchat:
    image: rocket.chat:4.8.4
    command: >
      bash -c
        "for (( ; ; )); do
          node main.js &&
          s=$$? && break || s=$$?;
          echo \"Could not start Rocket.Chat. Waiting 5 secs...\";
          sleep 5;
        done; (exit $$s)"
    restart: unless-stopped
    volumes:
      - ./uploads:/app/uploads
    environment:
      - PORT=3000
      - ROOT_URL=https://chat.domain.xxx
      - MONGO_URL=mongodb://mongo:27017/rocketchat
      - MONGO_OPLOG_URL=mongodb://mongo:27017/local
      - MAIL_URL=smtp://smtp.email
    depends_on:
      - mongo
    ports:
      - 3000:3000
    labels:
      - "traefik.backend=rocketchat"
      - "traefik.frontend.rule=Host: your.domain.tld"

  mongo:
    image: mongo:5.0
    restart: unless-stopped
    volumes:
      - ./data/db:/data/db
      - ./data/dump:/dump
    command: >
      bash -c
        "while [ ! -f /data/db/WiredTiger ]; do
          echo \"wiredTiger migration hasn't started yet. Waiting 30 secs...\";
          sleep 30;
        done;
        docker-entrypoint.sh mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger;"
    depends_on:
      - migrator
    labels:
      - "traefik.enable=false"
    ports:
      - 27017:27017

  migrator:
    build: ./docker/
    volumes:
      - ./data/db:/data/db

  mongo-init-replica:
    image: mongo:4.4
    command: >
      bash -c
        "for (( ; ; )); do
          mongo mongo/rocketchat --eval \"
            rs.initiate({
              _id: 'rs0',
              members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
          s=$$? && break || s=$$?;
          echo \"Could not reach MongoDB. Waiting 5 secs ...\";
          sleep 5;
        done; (exit $$s)"
    depends_on:
      - mongo

 # hubot, the popular chatbot (add the bot user first and change the password before starting this image)
  hubot:
    image: rocketchat/hubot-rocketchat:latest
    restart: unless-stopped
    environment:
      - ROCKETCHAT_URL=127.0.0.1:3000
      - ROCKETCHAT_ROOM=XXX
      - ROCKETCHAT_USER=XXX
      - ROCKETCHAT_PASSWORD=XXX
      - BOT_NAME=XXX
  # you can add more scripts as you'd like here, they need to be installable by npm
      - EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
    depends_on:
      - rocketchat
    volumes:
      - ./scripts:/home/hubot/scripts
  # this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
    ports:
      - 3001:8080

Hi!

You should be fine just upgrading your docker (install it directly from docker, as some distros still use old version) and then using the latest docker-compose.yml

You will need to map the volumes accordingly.

if you want to upgrade your Rocket.Chat instance without upgrading your Docker, you can also change the version to 5.1.2 (latest version as of now) and doing a pull and a up -d, like so:

docker-compose pull
docker-compose up -d

Please, always backup before upgrading.