Jira 9.5.0 amps no longer able to boot from from old resource zip

Jira 9.5.x updates seem to have broken our integration build based on a generated zip with awkward to automate stuff like workflows. AMPS builds find on 9.4.x on 9.5.0 we get:

The write format 1 is smaller than the supported format 2

Without the zip data, amps boots fine so clearly some upgrade in h2db has occurred.

For the benefit of others, the path is pretty simply, just connect to the old h2 db using the older 1.4.x tools (eg 1.4.200 from Archive Downloads ) then export the db to a script (typically user is: sa , empty pass):

Create a sql dump

SCRIPT to '~/h2db.sql'

Create an empty h2 db
http://www.h2database.com/html/tutorial.html#creating_new_databases

From the h2 v2.x.x /bin/ folder:

java -cp h2-*.jar org.h2.tools.Shell

Key in the detail

Welcome to H2 Shell 2.1.214 (2022-06-13)
Exit with Ctrl+C
[Enter]   jdbc:h2:file:/home/andy/h2tests/h2db
URL       jdbc:h2:~/newhd2b 
[Enter]   
Driver    org.h2.Driver
[Enter]   sa
User        
Password  
Type the same password again to confirm database creation.
Password  
Connected
Commands are case insensitive; SQL statements end with ';'
help or ?      Display this help
list           Toggle result list / stack trace mode
maxwidth       Set maximum column width (default is 100)
autocommit     Enable or disable autocommit
history        Show the last 20 statements
quit or exit   Close the connection and exit

sql> quit
Connection closed

Relaunch the 2.1.x /bin/h2.sh and load the above clean db

RUNSCRIPT FROM '/home/andy/h2tests.sql'

At which point, in theory, put your zip back together and retry amps with 9.5.0, works for me!

1 Like

Hi Andy, Thanks for the workaround.

Yes, AMPS seems to work fine with Jira 9.5.0.

For example, this command successfully starts a Jira instance from an empty directory:

mvn amps:run-standalone -Dproduct=jira -Dproduct.version=9.5.0

However, any AMPS users who have a pre-9.5.0 Jira data zip will need to manually migrate that zip to the new H2 version.

The below technique works for any database type, not just H2.

  1. Start the “old” version of Jira, e.g. 9.4.0 (which uses H2 1.x).
  2. Export the system to XML via the Jira admin menu.
  3. Shut down Jira.
  4. Bump the Jira version to 9.5.0, but comment out the custom data zip (probably defined in their POM using the productDataPath element); this starts Jira 9.5.0 with the default (empty) data set (and H2 2.x).
  5. Import the XML file from step 2.
  6. Shut down Jira.
  7. Run mvn jira:create-home-zip to generate a new home ZIP (which contains H2 2.x data files)
  8. Replace the previous home ZIP with the new home ZIP and if it has a different name, update the productDataPath element to point to the new filename.

Hope this helps. Thanks @Andrew for your inputs.

1 Like

a maven clean after step 4 above could help too