Update H2 Database from 1.4.199 to 2.2.220
Not following these steps will result in data loss!
These steps are only required when a H2 database is used. No Migration is required when other databases are configured.
1. Download Driver for Migration:
2. Identify Path to *.h2.db file
<webapp>/<kgsPRoduct>/work/<product>/store/<product>.h2.db
3. Stop application Server ( make sure that *.lock.db files aren't in the folder anymore)
4. Backup H2 Files by copy all files in the folder to a new directory
5. Execute export Script
java -cp h2-1.4.199.jar org.h2.tools.Script -url "jdbc:h2:file:<PathToDBFile>;MODE=MySQL;AUTO_SERVER=true;cipher=AES" -user "kgs" -password "<password>" -script export.sql
Do not use a file extension in <PathToDBFile>. Example: the name of your db is “KGSMigration.h2.db” then only enter the path with the name of the database, here /webapp/migration/work/store/KGSMigration
6. Check the export File, it should not be empty and contains values from the tables
7. Download H2 Driver for migration target (=2.2.220):
http://www.h2database.com/html/download.html (Binary.jar)
8. Delete the V1 Database (<Product>.h2.db, don’t forget the backup!)
9. Create V2 File
java -cp h2-2.2.220.jar org.h2.tools.RunScript -url "jdbc:h2:file:<PathToDBFile>;MODE=MySQL;AUTO_SERVER=true;cipher=AES" -user "kgs" -password "<password>" -script export.sql -options FROM_1X
10. Start Application server and check database entries
11. Delete both H2 Driver and export.sql file.
Products/Modules with H2 integration
Name | Path (with Filename H2 1.3.175) |
---|---|
Protocolservice | <work>/protocol/store/KGSProtocol.h2.db |
Securityprovider | <work>/secprovider/store/secprovider.h2.db |
Migration | <work>/migration/store/KGSMigration.h2.db |
Proxy | <work>/proxy/store/KGSProxy.h2.db |
Lockservice | <work>/lockservice/store/KGSLockService.h2.db |
DocRouter4 | <work>/documentrouter/store/KGSDocRouter.h2.db |
ReadCache | <work>/readcache/store/KGSReadCache.h2.db |
WriteCache | <work>/writecache/store/KGSWriteCache.h2.db |
ScanServer | <work>/scanserver/store/scan.h2.db |