H2 database migration

H2 database migration

Since of 2403 Figaf Tool H2 database version was upgraded from `1.4.200` to `2.1.214` and database path was changed from <user_home_dir>/FigafIRT/irt-db to <user_home_dir>/FigafTool/db. If you have the on-premise standalone instance on H2 database and want to continue working with the data on it (we recommend to use H2 only for temporary evaluation and testing, PostgreSQL is more preferable), it's required to migrate database files from 1.* to 2.*. Otherwise, skip that step if you want to start from scratch.

Steps to migrate H2 database:
  1. Download drivers for https://repo1.maven.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200.jar and https://repo1.maven.org/maven2/com/h2database/h2/2.1.214/h2-2.1.214.jar
  2. Backup database to SQL script: java -cp h2-1.4.200.jar org.h2.tools.Script -url jdbc:h2:<user_home_dir>/FigafIRT/irt-db -user sa -script <script-name>.sql
  3. Create new database: java -cp h2-2.1.214.jar org.h2.tools.Shell -url jdbc:h2:<user_home_dir>/FigafTool/db -user sa
  4. Restore data: java -cp h2-2.1.214.jar org.h2.tools.RunScript -url jdbc:h2:<user_home_dir>/FigafTool/db -user sa -script <script-name>.sql -options FROM_1X