Does jira keep data in the H2 database after upgrade?

Christopher O_Neill June 29, 2020

I would assume that JIRA keeps what ever data has been added into the H2 database even after upgrade, but I would like to confirm this if anyone has done an upgrade does JIRA keep the data in the H2 or does it delete and recreate a new H2 DB?

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 29, 2020

No, it upgrades the data in the database, as you assume.

I regularly test upgrades with h2, rarely lose anything,  (Usually because I'm testing something unrelated to the database of course - you won't be using h2 for production data)

Christopher O_Neill June 29, 2020

Thanks I have only done 1 upgrade no issues but we manage some other instances and previous creator did not link the instance to a regular DB and after an upgrade somehow now the data is not there 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 29, 2020

The h2 database is good for a quick start and not having to find a real database to use as storage, but it is known to fail catastrophically without any warning.

If the data is missing after upgrade, my main route of investigation would be "h2 failed during upgrade".  I'd be reaching for backups of the pre-upgrade.  By default, Atlassian apps do regular backups, usually to <application home>/export, so I'd look there first.  (On the other hand, it's a dev/test system, so it might be more useful to look to a backup of production?)

Christopher O_Neill July 1, 2020

I checked on mine and see a bunch of zip files, and 2 folders snapshots and workflowexports. if any of these could be used to restore the H2 data. I assume I would have to move it to which ever directorate the H2 db uses to store data and unzip correct?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 2, 2020

Each zip file in "export" is a backup of all of the data.  I wouldn't worry about the snapshots or workflow exports, they're not part of the backup (workflows are in the backup zip as well)

You can't just unzip it.  The export is an xml representation of your data.  You'll need to create a new Jira installation and then use "restore from backup" to pull all the data out of the backup.

Like Christopher O_Neill likes this
Christopher O_Neill July 3, 2020

Thanks, I was tracking on using the tool within jira it self under system>import&export >system restore. Just wasn't sure on if I need to use the snapshots or anything else

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 3, 2020

It's just the xml backup you need (Jira zips them up for you), plus the attachments folder if you need to preserve those. 

For test systems, I tend to ignore the attachments - I generally don't care that an attachment is missing unless I'm specifically testing a preview or download function.  Jira works fine without attachments, just displays placeholder "missing attachment" pictures and tells you they're missing if you click to download.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.1
TAGS
AUG Leaders

Atlassian Community Events