Switching Jira DB

Anoop K Baby March 2, 2018

Hi,

     For a testing I tried to point my Dev Jira instance to another DB instance by changing the new db server parameters in dbconfig.xml Now when I tried to switch it back to my old db , Jira url loading to Setup Wizard. Anybody knows how I can avoid the Setup Wizard as my db still exists with old data.

3 answers

0 votes
SL April 21, 2021

I had exactly the same issue today. I actually didn't edit dbconfig.xml each time. Before I switched to the new DB I made a backup copy. When switching back I just renamed the files.

At the time Jira presented me the setup wizard, my directory listing looked like this:

-rw------- 1 jira root 1096 Apr 21 07:07 dbconfig-new.xml
-rw------- 1 root root 1097 Apr 21 07:03 dbconfig.xml

Solution:

  • Stop Jira
  • chown jira:root dbconfig.xml
  • Start Jira

It looks like my issue was a permission issue in the end.

0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2018

Hi Anoop,

You'll need to go through the normal setup and then use the JIRA Configuration utility.  Take a look at Using the JIRA application configuration tool for instructions on using this.

Cheers,

Branden

Anoop K Baby March 5, 2018

 I have tried to proceed with setup wizard and I used my own database option, I gave my existing database credentials, but it not leting me to proceed. its throwing following message 

"You have specified a database that is not empty, please specify an empty database. If you want to upgrade an existing installation, please follow these instructions instead. "

I tried to run .bin/config.sh also, and used the "Database Selection" option, but that also failed. Do you know how the setup wizard prompting due to which config or cache setting.

Thanks,

Anoop

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 12, 2018

The initial setup wizard will not let you select an existing database that already has data in it.  It is not designed for that.

However you should be able to stop Jira and run the Jira Config tool as a means to change the database being used.  When you use this, it should be updating the $JIRAHOME/dbconfig.xml file.

This file is what determines how Jira will connect to your database on startup.

 

What happens when you try to change the settings in the config tool and then save these?  Do you see an error message there that the file cannot be saved?  It could be that the account you launched that config.sh file might not have the correct permissions to write/edit the file in that path.   But that is about the only reason I could understand as to why you changes might not be saved.

 

You can try to edit the dbconfig.xml file directly as a means to change this settings back.

Depending on your database type, you can see a sample dbconfig.xml file near the bottom or the respective links on Connecting Jira to a database.

 

Please note that after you have saved changes to the dbconfig.xml file, you will need to start Jira again in order to see those changes take effect.

Anoop K Baby March 12, 2018

Thanks for the update. But my dbconfig.xml file already existing the db credentials which I am trying to connect. Config.sh shows an error as "*** Connection failed: Could not connect to the DB: Login failed for user 'jiradbuser'. ClientConnectionId:61170270-425a-44f8-9a07-96f9f4f4e0a6" , but on the UI if I try to proceed the setup wizard with same login credentials, it prompting as db is not empty. Its not a DB connectivity issue. 

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 13, 2018

If the connection test in the config utility tells you login failed, then the SQL login failed.   Simple as that.   That failure is more significant to me than the oddities to see in the setup wizard.  That part of the wizard is expecting to create a new database.

As I see it you have a few different troubleshooting options here:

  1. Try to change the password for this SQL user and then update the dbconfig with this new info.  It would also help to use the config.sh utility to test the database connection to confirm this works.  If you can get that test to pass, then Jira should be good when starting up with those settings.
  2. Create a new SQL user that has proper permissions for this database

    OR
  3. At this point it is probably better just to create a new blank database for Jira per the explicit instructions in Connecting Jira to a database , connect Jira to this database, start Jira, and then use the setup wizard to import an XML backup Jira made of that database.   Steps on doing this are in Migrating JIRA applications to another server.  Specifically if you go to section 3.6 of that guide it explains how you can import
0 votes
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 2, 2018

Hey Anoop, 

As I recall, you do need to run through a portion of the setup wizard, but it will detect that there is already data in there and allow you to connect without overwriting.

 

Thanks, 

Kian

Anoop K Baby March 5, 2018

I have tried to proceed with setup wizard and I used my own database option, I gave my existing database credentials, but it not leting me to proceed. its throwing following message

"You have specified a database that is not empty, please specify an empty database. If you want to upgrade an existing installation, please follow these instructions instead. "

I tried to run .bin/config.sh also, and used the "Database Selection" option, but that also failed. Do you know how the setup wizard prompting due to which config or cache setting.

Thanks,

Anoop

Suggest an answer

Log in or Sign up to answer