Recovery

Learn how to recover the existing installation of CourseLit

It may happen that you lose access to the passwords etc. that you provided to the installer. This will stop you from installing the updates.

Under the hood, CourseLit uses MongoDB as the database to store user created content (except external files like images, videos, PDFs etc.).

When you install CourseLit for the very first time, it sets up an admin user in order to enable authentication on the MongoDB server. This is for securing the database server.

The application uses this admin user to securely connect to the database. If on the subsequent maintenance, you provide a different user name or password, the application will fail to connect to the existing database.

Recovering the Database User

Step 1. Log into your server.

Step 2. Start a new MongoDB instance with authorisation disabled, which accesses the MongoDB files from the last installation.

# /path/to/last/installation/media/folder should be the value which you specified while
# setting up CourseLit for the first time. The default value is ~/courselit-data.
docker run -p 27017:27017 -v /path/to/last/installation/media/folder/mongo/data/db:/data/db mongo

Step 3. Start a new Mongo shell session.

Step 4. Get the list of the admin users.

db = db.getSiblingDB('admin')
db.getUsers()

Step 5. Reset the password of the admin user.

db.changeUserPassword("admin_user_from_step_5", "NEWPASSWORD")

Step 6. Re-run the installer with these new settings.

Don't forget to save these details now :)

Something's Not Clear?

Come chat with us in our official Discord channel.

Last updated