Auto Init Mode
Data Hub provides a configuration property that allows you to control what happens to the database schema during start-up.
Auto-initialization of the Data Hub database schema is possible during the start up cycle of Data Hub. To specify how and if this auto initialization occurs, add the property datahub.autoInitMode to your local.properties file, as follows:
datahub.autoInitMode=create
The auto initialization mode has the following options:
- ignore: When datahub.autoInitMode is set to ignore, the schema is not initialized during startup. If a compatible schema exists, Data Hub uses that schema. If no schema exists, or the schema is incompatible, Data Hub startup fails.
- create: When datahub.autoInitMode is set to create and there is no existing schema, a new schema is created. If a compatible schema already exists, Data Hub starts up normally.
- create-drop: When datahub.autoInitMode is set to create-drop, any existing schema is automatically dropped, and a new schema is created. This mode is not suitable for production environments, as loss of data may occur.
The default value for datahub.autoInitMode is create.
Auto Init Mode and Metadata
The loading of metadata is independent of the autoInitMode setting. Any new or changed metadata is always loaded when starting up Data Hub, even in ignore mode. The only time the autoInitMode setting affects existing metadata is in create-drop mode. In this case, drop the entire database schema, and all persisted data is deleted, including metadata. Data Hub then loads any metadata it finds into the fresh schema as part of the normal start-up routine.
Upgrade Process
To upgrade Data Hub to the current version, do the following:
- Stop the Data Hub server.
- Set the datahub.autoInitMode property value is set to either create or ignore.
- Run the {{migration/sql/1808+_to_latest/datahub-<your_db>.sql script from the Data Hub Suite distribution.
- Restart the Data Hub server.