Rocket.chat: Error while restoring the database

Created on 23 Nov 2017  路  2Comments  路  Source: RocketChat/Rocket.Chat

Description:

I have a Rocketchat running on a Windows server with docker that was formated and i don't know what was the image versions of mongo and Rocketchat.
I made a mongodump on my rocketchat docker database before the server was formated.
But now, with the Ubuntu 16.04 installed on the server and MongoDb 3.4.10, when i did a mongorestore:

mongorestore --db rocketchat --drop /data/rocketchat --batchSize=50

this error shows up:

2017-11-23T13:52:29.715+0000 Failed: rocketchat.rocketchat_uploads.files: error creating indexes for rocketchat.rocketchat_uploads.files: createIndex error: The field 'w' is not valid for an index specification. Specification: { name: "filename_1", ns: "rocketchat.rocketchat_uploads.files", w: 1, key: { filename: 1 } }

Searching on the internet, i ended up with this:

mongorestore --db rocketchat --noIndexRestore --drop /data/rocketchat --batchSize=50

Now i can login, but all the messages conversations get this error:

No Named User "Jeferson-Simao" was found!

There's a way to remake the indexes or restore db without error?

Server Setup Information:

  • Version of Rocket.Chat Server: latest
  • Operating System: ubuntu 16.04
  • Deployment Method: docker
  • Number of Running Instances: 1

Steps to Reproduce:

Here's the commands i used to dump:
docker exec -it md_mongo_1 mongodump -h localhost -d rocketchat
docker cp md_mongo_1:dump/rocketchat

Restore:
docker exec -it md_mongo_1 /bin/bash
mongorestore --db rocketchat /data/rocketchat --batchSize=50

Most helpful comment

No need to downgrade though...
Just don't restore the indices with the data:
mongorestore --host "mongodb:27017" --drop --noIndexRestore --db rocketchat ...

You might need to recreate the indices right after with the reIndex command.

All 2 comments

Okay, it was easy.

I Just downgraded mongodb to 3.2 and it works.

No need to downgrade though...
Just don't restore the indices with the data:
mongorestore --host "mongodb:27017" --drop --noIndexRestore --db rocketchat ...

You might need to recreate the indices right after with the reIndex command.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marceloschmidt picture marceloschmidt  路  3Comments

neha1deshmukh picture neha1deshmukh  路  3Comments

royalaid picture royalaid  路  3Comments

mattlin picture mattlin  路  3Comments

karlprieb picture karlprieb  路  3Comments