Migrating K2B Audit data from version 7.x to 8.0

NOTE: If your are migrating from versions of K2B Audit earlier than 7.x, you must follow the steps required to migrate to version 7.x first.

Live records timestamp implementation

Implementation of Live records timezone may, if not considered and in some scenarios, cause live records timestamps to overlap. Please read carefully to make your decision.

Earlier versions of K2B Audit always store Live records' timestamp using the database server time zone. If the Datetime storage timezone environment property was set to either Undefined or Application Server, there was no problem and there are not migration issues to consider.

If it's value was GMT/UTC, accessing Live records' timestamp from GeneXus generated objects show their value shifted by the difference between the database server time zone and UTC time zone. Say, for example, an audit record was added on June 22, 2022 at 11:32 AM as of the database server time zone. If the database server time zone offset is -3:00, the actual value shown in GeneXus generated programs is June 22, 2022 at 2:32 PM.

Migrating to K2B Audit version 8 automatically fixes the above problem for live records added AFTER re-creating all database triggers. It DOES NOT CHANGE any already existing records that will continue to show their shifted value.

The timestamp of already existing live records that span over the time zone offset of the database server may be overlapped by the new generated records.

To avoid the risk of overlapping the time lapse between the last audit record added by "old" triggers and the ones added by the "new" ones must be equal to or greater than the time zone offset. This may only happen on some off-line periods.

What happens if there are overlapping timestamps?

Statistics and determining actual sequence of events for the time period equivalent to the time zone offset may be affected.

Analyzer database structure

K2B Audit 8.0 has slightly changed the 7.x database structure to improve milliseconds support. A database reorganization is required that should be deployed to and run on all application installations.

This document describes a deployment alternative that easies development work.

Migrating data to K2B Audit 8.0 structure require a few SQL commands to be executed. These commands are grouped into SQL Scripts that must be run using the utility provided by the DBMS.

SQL Scripts location

SQL Scripts to migrate data to K2B Audit 8.0 database structure are located in subdirectory 'Packages\K2BTools\Audit\MigrationScripts\ToVersion80'. The subdirectory is located under the GeneXus installation directory.

The following table shows the SQL Script name for each DBMS.

DBMS Script name
MySQL MySQL.sql
Oracle Oracle.sql
PostgreSQL PostgreSQL.sql
SQL Server SQL Server.sql
iSeries DB2400.sql
DB2 Universal Database n/a