Forums

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

Corrupted Jira Instance (Need help finding specific files)

Harvey Bennett
Contributor
August 5, 2019

I made a mistake when I started to modify Jira on my backend that ultimately throws a 500 errors now whenever I try to load my website. This is a personal instance that I run for personal testing purposes that I do not back up (even though I realized now I should have). Anyways, I have Groovy files that are attached at various locations in the workflow and listeners. Is there any way to retrieve these files or does anyone know the default location that they are stored at? I'm running a Linux env and tried recursively looking through the root of my drive and only came back with a few files even though I have roughly 20. So are they also named with a different extension that isn't .groovy? Thanks for the insight!

2 answers

1 accepted

2 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 6, 2019

Hi Harvey,

I am afraid my knowledge of groovy script locations as they relate to Jira is limited.  However if these are stored in the Jira database, then it's possible you have a backup of these and don't know it yet.   That's because Jira Server will automatically create an XML backup of your Jira database in a zip file approximately every 12 hours.

You can find these in the $JIRAHOME/export/ folder  These typically have a filename such as 2019-Aug-06--1235.zip   This zip file contains two specific XML backup files that contain everything that exists in your Jira database.  So, if these scripts are somehow stored by scriptrunner in an AO (active objects) table, it could be possible for you to recover these from a previous backup.

It might help to check out the Creating a test environment for Jira.  It has steps for how you can spin up a new Jira instance to test this out.    By creating a new empty database, and connecting your new install to this database, you could also include the scriptrunner plugin.jar file in the $JIRAHOME/plugins/installed-plugins/ directory (this is important to being able to see/import that data from the backup). 

From there when you start up this new Jira instance with an empty database, the setup wizard will launch.  You can use the 'import existing data' link in that setup wizard and then copy this backup.zip file into your $JIRAHOME/import/ folder.  This way you can import that backup.zip file into a new Jira site. 

Again, this would only help if those script are stored in the Jira database, and I'm not 100% that they are here. 

Andy

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 7, 2019

@Andy Heinzeris right - there are three places to look for scripts

  • Inline ones are stored in the database
  • <jira home>/plugins/scripts
  • Anywhere you might have told SR to run a script from (if you've used "read script from file instead of the inline box)

Most of us write scripts inline, so they can be found in the database.  Personally, I prefer "read script from disk" because I can point it at a source code repository.  And when we do use disk, I tend to keep them under <jira home>/plugins/scripts anyway.

Like Andy Heinzer likes this
1 vote
Harvey Bennett
Contributor
August 8, 2019

I got the opportunity to do a restore yesterday and can confirm that this works. Thank you very much

Suggest an answer

Log in or Sign up to answer