Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to restart JIRA with a new external database [oracle sql]?

Aditya November 28, 2018

Hi Everyone

Two weeks back our VM which is hosting JIRA service rebooted automatically. So, we didn't have a chance to properly shutdown Tomcat. The restart of JIRA was failing as embedded DB was not starting up. Upon close inspection of logs, we found that DB was corrupted due to abrupt shutdown of tomcat server. 

Now we have inducted a new external DB (Oracle SQL), and it is running. We have also created a new JIRA-HOME directory, and changed the configuration in jira-application.properties file. Fortunately, the data in embedded hSQL DB is backed up in export folder. 

The question is: how do I restart JIRA because now I won't get the option of connecting to an external DB in a startup GUI? How do I do it? Once JIRA starts successfully, we will import the backed up data. 

Need Help!

Regards

1 answer

0 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 28, 2018

Hey Aditya,

The database can be configured in a file called dbconfig.xml in Jira's home directory. We've got documentation on what goes in this file as well as a sample you can reference and modify.

But, even easier than that, you can simply remove or rename the file and Jira's setup wizard will run again when you start it up! The lack of the dbconfig.xml file is what triggers the setup wizard.

One additional thing I'll note since you mentioned you're on Oracle - you'll want to use the version 12.2.0.1 driver which you can obtain here from Oracle. The ojdbc8.jar file needs to go into the lib folder in your application install directory, and any older ojdbc8.jar/ojdbc7.jar files should be removed from that directory. Other releases of the Oracle 12c drivers have had various issues working correctly with Jira.

Cheers,
Daniel

Aditya November 28, 2018

Hi @Daniel Eads

If I go for option 1 (dbconfig.xml), will JIRA pick up the DB config and connect itself to oracle instead of hSQL?

We have downloaded and placed an ojdbc8.jar in the lib folder :)

My only fear is will the backed-up data import properly? Will the user accounts & projects be safe? 

NB: Our new JIRA-HOME directory doesn't have any file & folders. It is completely empty. It will fill up only upon a restart. 

Regards

Aditya

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 30, 2018

If I go for option 1 (dbconfig.xml), will JIRA pick up the DB config and connect itself to oracle instead of hSQL?

There will already be a dbconfig.xml file in place that instructs Jira to connect to the h2/hSQL embedded database. If you modify the connection parameters in that file, it won't try to use hSQL anymore.

If that file isn't there, then the configuration wizard will guide you though a database connection when you start Jira. If it's a new empty Oracle database, you should also have the option to import when the wizard runs! Note that Jira will expect to import from an XML file (you would generate this from a running Jira). It won't pick up the data from an old embedded hSQL database automatically. We've got docs for generating the XML backup if that's not the backup you're referring to that you already have.

Jira's home directory contains files like attachments that aren't included in a database backup (like the XML backup). You'll need to copy in these files separately to make sure they are imported.

The users, projects, and issues are in the database/XML backup. The attachments on issues are in the home directory and need to be manually copied in to your new home directory.

Suggest an answer

Log in or Sign up to answer