Connecting your Jira application to Database

Sherly Febrianti
5 min readJun 9, 2020

--

Hi CelSius, — that’s how i call my pal 😆

After doing the Jira Application Installation, today i’m going to connecting the installed Jira Application to Database.

The installation will following this documentation.

Currently i’m going to use PostgreSQL since it has been installed in my local computer.

I’m using the existing specification on my current laptop.

  • MacOS Mojave v.10.14.6
  • postgres (PostgreSQL) 12.1
  • openjdk version “11.0.5” 2019–10–15
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
    OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)

Creating a new Jira Database User

First, you have to start your postgresql.

Then login to your postgres.

Create a database user jiradbuser, so your Jira can connect to the database.

After creating the jiradbuser, you have to check if it has been exist.

// Commands you can use :// Start your Postgresql service
brew services start postgresql
// Login to your Postgres
psql -U postgres
// Create user jiradbuser
CREATE USER jiradbuser WITH PASSWORD 'jiradbuser';
// Check user detail (can be used to check user has been exist)
select * from pg_roles where rolname = ‘jiradbuser’;

Creating a new Database for your Jira

Create a database jiradb, using Unicode collation.

After run the create command, then check the jiradb has been created.

// Commands you can use :// Create Database
CREATE DATABASE jiradb WITH ENCODING ‘UNICODE’ LC_COLLATE ‘C’ LC_CTYPE ‘C’ TEMPLATE template0;
// Check DB detail (can be used to check DB has been exist)
SELECT * FROM pg_database WHERE datname=’jiradb’;

Setup the Jira User privilege to the database

Currently the Jira User we have create still don’t have any connection to the database we have been created.

So, what we gonna do is setting the privilege jiradbuser to have access to jiradb.

You can check the jiradb details by selecting from pg_database.

Command you can use :

  • GRANT ALL PRIVILEGES ON DATABASE jiradb TO jiradbuser;

Connecting your Jira Server to your PostgreSQL DB

Make sure you have installed Jira Application.

Then run the config.sh in your terminal.

Then it will showing you a popup display to specify your Jira Home Directory

choose the Jira Home Directory as per configured.

then click Save button.

Go to the Database tab, choose the Database type : PostgreSQL, and fill the informations based on the configurations we have configured.

fill the Database configurations based on what we have configured.

Then click on Test Connection to check if it has been correct.

testing the connection to check the database can be connected.

Then click on Save button and then Close button.

After the configuration has been done, then run your existing Jira Application.

Running the startup.sh on terminal.
Running the start-jira.sh on terminal.

Access your Jira Application (by accessing http://localhost:8080/), now it should displaying the setup wizard that will only appear one time after you installed your Jira Application.

In my case, i still had this error (by running start-jira.sh) :

Running jira application on browser.

So, i did stop the service by running stop-jira.sh and shutdown.sh.

Currently i’m going to re-run the startup using this disabled warning flag :

startup.sh -Djira.startup.warnings.disable
Running startup.sh using disabled warning flag.

And then start again the Jira application.

Running the start-jira.sh on terminal.

Setup on your First Time Running application

Access your Jira Application again (by accessing http://localhost:8080/), and it will redirecting you to First Time Setup Application page.

First time setting up page for your jira application.

When you click on Next button, they will asking you the lisence for your Jira Application.

Specify lisence for your jira application.

In this case, we will generate the trial license (you have to register and have your own atlassian account to generate the trial license).

After the click the Generate Lisence, it will showing confirmation popup and click OK button.

It will automatically redirecting you to your setup page.

Setup Jira application with generated license key.

Creating the administrator account

When clicking on the Next button, it showing Set up administrator account page.

After fill the form and click on the Next button, you will see Set up email notification page.

After you finished doing the configurations, now you are good to go.

Now your Jira application has been installed successfully.

Summary

If you don’t like the long explanation, here is the checklist you have to do :

  • Make sure you have doing Jira Application Installation
  • Create a new Jira Database User
  • Create a new Database for your Jira application
  • Setting up the Jira User privilege to the database
  • Start connecting the Jira Server to the configured database (PostgreSQL)
  • Restart your jira application
    (run with -Djira.startup.warnings.disable if you have warning about your database version)
  • Doing the First Time Setup Application
  • Setting up your administrator account

Now, you can use your Jira application. Cheers!

--

--

Sherly Febrianti
Sherly Febrianti

Written by Sherly Febrianti

A passionate developer who loves design

No responses yet