Database
...
MongoDB
Examples of authorization sett...

Setting up authorization in Docker

11min

Backing up and cleaning MongoDB data

Creating a backup

Go to the root directory of the Passwork installation:

Shell


Run the backup script:

Shell


Clearing collections and data

Stop and delete the passwork_db container:

Shell


Clear previously created MongoDB collections and data:

Shell


Create a MongoDB user and start the container

Creating a user

Edit and complete the .env variable file. Insert the following lines and specify your values:

Shell


You can't use characters in MongoDB — .,@,$,:,%,",',/,\,| in the username and password, as this may cause malfunctions in the connection of the application server to MongoDB.

Starting the container

Start the passwork_db container:

Shell


Check the running container:

Shell


Restoring from backups and connecting Passwork

Restore databases

Run the restore script:

Shell


Specify the created backup from step one:

Shell


Verify connection to MongoDB with authorisation:

Shell


Setting up and connecting Passwork with authorization

You need to edit the Passwork configuration file — /<passwork>/conf/keys/config.ini section [mongo] specifying the login and password of the created user:

Shell


Save the changes and refresh the Passwork web interface page to test the connection with MongoDB authorisation.