Continuous Database Updates

Note: This feature works with databases that have already been updated to the V.25.1 level.

Note: For general information on updating the database, see How to Update an Uncustomized Schema after an Archibus Upgrade.

Overview

The process of running DUW upgrade scripts can be automated. The basic process is for a workflow rule to go through all the DUW scripts in sequence and run each one. This process uses the Archibus Automatic Database Updates table (afm_autodbupdate) to determine the current database version and previous scripts that have been applied.

Continuous database updates are useful for:

Sequence

In general terms, the workflow rule follows this sequence:

  1. Determine the current database and scripts that have been run.
  2. Start at the folder that is next after the folder for the last successfully-run script. This is indicated in the afm_autodbupdate table (for example, \projects\users\public\dt\24.1.001).
  3. The rule advances in the list to the folder name that matches the value.
  4. The rule advances to the next folder (e.g. \projects\users\public\dt\24.1.002).
  5. Starting from this folder and for every folder thereafter, the rule executes the update-schema.duw DUW script within each folder (e.g. projects\users\public\dt\24.1.002\database-update.duw), pausing for one minute between the end of the last script and the beginning of the new one.
  6. For each folder name (e.g. projects\users\public\dt\24.1.002), the rule:
    • Inserts a new record into the afm_autodbupdate table. The insert statement includes the date_run and script_folder values, but leaves the success value at its default of No (0).
    • Runs the update-schema.duw script in that folder.
    • If the DUW script succeeds:
      • The rule sets the afm_autodbupdate.success value for this script_folder to 1 (Yes).
      • The rule continues to the next folder in the list.
    • If the DUW script fails:
      • The rule stops and does not process the next DUW script in the next folder folder.

      • If all DUW scripts have succeed, create the empty file \archibus\users\public\dt\database_update_wizard.done. (In this way, an external batch file will know when the script has finished.)

Executing continuous update workflow

In a future release, users will be able to invoke the continuous database update feature. Currently, Archibus staff use this procedure for Archibus SaaS deployments.

Config file

The \WEB-INF\config\autodb-update.properties file stores the run script configuration for Continuous Database Updates workflow.

Property Name

Description

Default Value

autodb.root.path

Root path. This property is needed to limit the upper level.

If you want to run everything under 24.1.004 and not all from the /dt/xx.x.xx folder, then set duw.root.path=dt/24.1.004

%publicDataTransferDirectory%

autodb.delay

Adds a delay in millisecond after each main update-schema.duw runs.

10000

autodb.root.file

Root file to be executed. If it does not exist, the process stops.

update-schema.duw

autodb.filename.marker

Name of the marker file

database_update_wizard.done

Workflow

Use cases

Configuration to consider

The WEB-INF\config\auto-dbupdate.properties file specifies a set of configuration parameters that Continuous Update Database uses to upgrade the DB. Theautodb.root.file parameter specifies the root file to be executed. This exists in /projects/users/public/dt/xx.x.xxx.

Based on your use case, you modify the autodb.root.file to point to any of the files:

Update the schema and hq databases from the previous versions

Verify if the WEB-INF\config\auto-dbupdate.properties has the following setting for autodb.root.file

autodb.root.file=update-schema.duw

Update only schema for either the hq or schema database

Verify if the WEB-INF\config\auto-dbupdate.properties has the following setting for autodb.root.file

autodb.root.file=update-schema.duw

Update the schema and the Sample-Data for either the hq or schema database

Verify if the WEB-INF\config\auto-dbupdate.properties has the following setting for autodb.root.file

autodb.root.file=update-database.duw