Images served from different Server URL after migrating to another server/domain name


I’m in the process of upgrading my Rocket Chat installation from 5.x to 6.0, while also upgrading my distribution and going from Docker Compose V1 to V2.

To test this, I’ve created a staging server where I installed the latest version of my distribution and setup Docker Compose and Nginx. I changed the ROOT_URL from to Then I ran docker compose up -d, restored from a mongodb dump using --drop, and all seemed well… except the images are all being served from

New Images are served from, but the old ones from the database dump, which are all still there, are served from when I click Attachments in a direct chat and hover over the image.

I’m using GridFS for my images, so they’re stored inside of MongoDB. I’ve tried restarting the containers, upgrading the Rocket Chat container incrementally to 6.2…but it remains the same.

The Site URL in Rocket Chat General settings was set to, so I set it to, but that didn’t help.

Does anyone have any ideas as to what might be causing this? A quick docker compose logs reveals a lot of output, but no bright orange or red warnings. I don’t know much about MongoDB yet.

Server Setup Information

  • Version of Rocket.Chat Server: 6.2
  • Operating System: Ubuntu 22.04 LTS
  • Deployment Method: Docker Compose
  • Number of Running Instances: 1
  • NodeJS Version: v14.21.3
  • MongoDB Version: 5.0
  • Proxy: nginx
  • Firewalls involved: None

Any additional Information


    image: rocketchat/
    restart: unless-stopped
      - ./uploads:/app/uploads
      - PORT=3010
      - ROOT_URL=
      - MONGO_URL=mongodb://mongo:27017/rocketchat?directConnection=true
      - MONGO_OPLOG_URL=mongodb://mongo:27017/local?directConnection=true
      - OVERWRITE_SETTING_Show_Setup_Wizard=completed
      - mongo-init-replica
      - 3010:3010
      - "traefik.enable=false"

    image: mongo:5.0
    restart: unless-stopped
     - ./data/db:/data/db
     - ./data/dump:/dump
    command: mongod --oplogSize 128 --replSet rs0
      - "traefik.enable=false"

  # this container's job is just run the command to initialize the replica set.
  # it will run the command and remove himself (it will not stay running)
    image: mongo:5.0
    command: 'mongo mongo/rocketchat --eval "rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''mongo:27017'' } ]})"'
      - mongo

Specifically, the images are served from:

As opposed to new images being served from:

So after learning some mongo shell commands, I did this:

docker exec -it docker-rocketchat-mongo-1
use rocketchat;

And I discovered that the URL seems to be hardcoded?

{ "_id" : "xxxxxxxxxx", 
"name" : "imagename.png", 
"size" : 314654, 
"type" : "image/png", 
"rid" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxx", 
"userId" : "xxxxxxxxxxxxxx", 
"store" : "GridFS:Uploads", 
"_updatedAt" : ISODate("2021-05-11T07:09:37.891Z"), 
"instanceId" : "xxxxxxxxxxxxxxxx", 
"identify" : { "format" : "png", "size" : { "width" : 2998, "height" : 2991 } }, 
"complete" : true, 
"etag" : "xxxxxxxxxx", 
"path" : "/ufs/GridFS:Uploads/xxxxxxxxxxxx/imagename.png", 
"progress" : 1, 
"token" : "6b98391969", 
"uploadedAt" : ISODate("2021-05-11T07:09:37.909Z"), 
"uploading" : false, 
"url" : "", 
"description" : "A really old image", 
"typeGroup" : "image" }

I’m not really sure what to do now.