Migrating self-hosted 4.7.2 -> Docker ... Users cannot login

Description

I’m trying to move a self-hosted 4.7.2 installation (Centos 7) in a local Docker environment to perform upgrade and future Docker production deploy.

I am ending up in a working installation but existing users cannot login (it says “user not found or wrong password”) so I am stuck

Server Setup Information

  • Version of Rocket.Chat Server: 4.7.2
  • Operating System: Centos 7
  • Deployment Method: Migrating to Docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: N/A
  • MongoDB Version: 4.4

Any additional Information

This is what I did:

  • Dumped the old DB from Centos 7 machine
    mongodump --archive --gzip > db.gzip

  • Started the local Docker Mongo container :

  • docker run --name db -d mongo:4.4 --replSet rs0 --oplogSize 128

  • docker exec -ti db mongo --eval “printjson(rs.initiate())”

Imported the old DB dump :

  • docker exec -i db sh -c ‘mongorestore --archive --gzip’ < db.gzip

Started the Rocketchat instance (used 4.8 version to ensure minor migration) :

  • docker run --name rocketchat -p 80:3000 --link db --env OVERWRITE_SETTING_Show_Setup_Wizard=completed --env ROOT_URL=http://localhost --env MONGO_OPLOG_URL=mongodb://db:27017/local -d rocket.chat:4.8

Went to http://localhost … Rocketchat is working, but I cannot login with any existing user :frowning:

If I ssh into DB container and launch “show dbs” I see data had been well imported in the rocketchat DB (same name as Centos DB) :

rs0:PRIMARY> show dbs
admin 0.000GB
config 0.000GB
local 0.415GB
meteor 0.004GB
rocketchat 0.474GB

I also tried to start the Rocketchat docker container with latest version, migrations went OK but still can’t login…

Any help on how to troubleshoot is really appreciated.

Hi!

I suggest you try using our official docker compose.

you will spin it up, with the exactly same version you are running on your old server.
then restore the data. After that you can change versions properly (If migrating to 5.0)

This is our doc of reference for Backup and Restore

And this is where you can find the official docker compose:

let me know if this helps :slight_smile:

Hi and thanks for your help ,
actually I am unable to find a valid 4.7.2 Docker image,
looks like official images are starting from 4.8 :

GitHub - RocketChat/Docker.Official.Image: Docker hub - community managed image

that’s why I restored my v4.7.2 into a v4.8 container

I think i followed the official guides correctly as you see in my first post, actually
the RocketChat container starts correctly being linked to the imported DB, the only (big) problem is that users can’t log in and I don’t know how to debug this…

Do you have any special auth config in place?

if you inspect the users collections at your mongo, you will see a services attribute.

That’s where all the auth related services will live.

here is the image you are looking for:
https://hub.docker.com/layers/rocketchat/rocket.chat/4.7.2/images/sha256-794cf31472314f48f2c8644686f560c674afc094d102f236292548783bb51ce3?context=explore