< All Topics

Using External Database

NirvaShare is bundled with in built Postgre database. In case if you wish to use an external database for better data management, you can do so by pointing to an existing external Postgre database by following the below steps. NirvaShare will automatically recreate the required schema with initial seed data. Make sure you use Postgre server version 13.2

  • Login to the server where NirvaShare is installed using SSH as root or a sudo user.
  • Create or edit if already exists, the file /var/nirvashare/config.properties¬†
  • Add below database entries and make sure to specify correct hostname, db name, username and password.
  • Save the file,
ns_db_jdbc_url=jdbc:postgresql://<db hostname>:5432/<db name>
ns_db_username=<db usrename>
ns_db_password=<db password>

Secure Database Connection

To use a secure SSL connection with the database, additional parameters have to be passed as shown below. These parameters will force NirvaShare to use SSL connection with database and not do any host certificate validation. Host certificate validation can be enabled in case of CA certificate.

ns_db_jdbc_url=jdbc:postgresql://<db hostname>:5432/<db name>?ssl=true&sslmode=require&sslfactory=org.postgresql.ssl.NonValidatingFactory
ns_db_username=<db usrename>
ns_db_password=<db password>

Restart Services

After pointing to an external database, NirvaShare services have to be restarted. Use the below commands to stop both Admin Console and User Application.

docker restart nirvashare_admin
docker restart nirvashare_userapp

Stop Database service

Now that, NirvaShare is pointing to an external database, the built-in database can be stopped using the below command.

docker stop nirvashare_database
Table of Contents