Jump to: navigation, search

iWD History Node Database Schema Migration

There are two scenarios to note when you should perform database schema migration:

  • Creating a database schema from scratch in the initial startup process.
  • Updating the database schema when upgrading iWD History Node to a new version.

In both cases it works the same way. Complete either one of the following procedures:

  • Enable automatic database schema migration by setting the value of Configuration Server option [iWD]/migrate-schema to true. This means that the application will check the current data schema at startup and update (or create) it if necessary. Note that default value of [iWD]/migrate-schema is false. Or;
  • Migrate the schema manually using the command line as shown below:
    • Linux./iwd_history.sh -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db migrate
    • WindowsJavaServerStarter.exe -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db migrate
Important
All commands like "./iwd_history.sh" and "JavaServerStarter.exe" should be executed from the directory where History Node has been installed.

Troubleshooting

Schema migration can sometimes get stuck in a loop that prevents History Node starting. When this happens, the following entries are written to the log file:

INFO  [2017-05-26 10:10:57,497] com.genesyslab.iwd.history.HistoryApplication: Running database schema migration
INFO  [2017-05-26 10:11:03,313] liquibase: Waiting for changelog lock....
INFO  [2017-05-26 10:11:13,317] liquibase: Waiting for changelog lock....
...

To correct this, after stopping History Node application, do the following:

  • On Linux
  1. List any database locks.
  2. ./iwd_history.sh -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db locks --list
    
  3. Release the database locks.
  4. ./iwd_history.sh -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db locks --force-release
    
  • On Windows:
  1. List any database locks.
  2. JavaServerStarter.exe -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db locks --list
    
  3. Release the database locks.
  4. JavaServerStarter.exe -host CFG_SRV_HOST -port CFG_SRV_PORT -app HN_APP db locks --force-release
    
This page was last edited on July 6, 2020, at 08:16.
blog comments powered by Disqus