Table of Contents
Rocketchat server setup
Newer RC is deployed via official docker-compose files. You don't have to use all services as you can just run
docker compose -f compose.database.yml -f compose.nats.yml -f compose.yml up -d
to spin up the a subset of RC service stack and
docker compose -f compose.database.yml -f compose.nats.yml -f compose.yml down
to stop the instance.
Before upgrade, make a backup of the database:
docker exec rocketchat-compose-mongodb-1 sh -c 'mongodump --out=/var/backups/'
You should have now a backup in /var/backups on the host as this is mounted into mongodb container (compose.database.yml).
Edit the .env file with the new version by changing the RELEASE key and running compose up command from above.
DB restore
In case you need to restore the mongodb, spin up a fresh instance of RC stack enter the mongodb container and run restore command
mongorestore --drop /var/backups/
–drop will drop existing default collections from the fresh install.
Run the above compose down and up commands for mongo to pick the new restored changes.
If you are testing backups locally you will need to update the URL manually in the DB after restore. Enter the mongo container and in the mongo shell update the rocketchat settings collection:
- download
docker exec -it rocketchat-compose-mongodb-1 bash mongosh use rocketchat db.rocketchat_settings.update({"_id" : "Site_Url"},{$set:{value:"http://localhost:3000"}}) db.rocketchat_settings.update({"_id" : "Site_Url"},{$set:{packageValue:"http://localhost:3000"}})
Here we updated the value to point to our localhost instance. If the browser is still showing the setup wizard, clear the cache.
