Generating rule schema objects and upgrading data
This article explains the steps involved in the data-only upgrade process when upgrading an application from PRPC 5.x or PRPC 6.x to Pega 7. It also captures the steps involved in generating rule schema objects. The scope of this article is for Pega 7 release versions only (until Pega 7.1.7).
Data schema should only be upgraded after completing the below steps:
Generating rules schema objects
In this step, all of the triggers, views, and procedures that are created during the rules upgrade process are dropped.
This process regenerates all of the triggers, views, and procedures along with appropriate qualified schema names. For example, all of the triggers contain the insert queries in the pr_sys_updatescache table, which is present in the data schema. This is important for pulse processing.
If the data schema is not mentioned in the properties file, then it points this table to the rules schema, and Pulse processing functionality does not work in multi-mode deployment.
Set the following properties in the migrateSystem.properties file before running the migrate .bat file.
Set the following properties to true to generate and apply rules objects.
Pega.rules.objects.apply
to false
The entire generated DDL file is available in the scripts folder.
Upgrading data schema
The data schema upgrade does not interfere with the work objects. This process does not have any impact on custom data.
- Common language runtime (CLR) must be enabled on the MSSQL database.
- Java must be enabled in the Oracle Database. This is required only if there is a plan to apply User Defined Functions (UDFs). This is used for unexposed columns (BLOB) reporting.
The Data Schema Upgrade is driven by the setupdatabase.properties file. As a part of this process, the file executes the following targets in setupdatabase.xml.
The data schema upgrade runs the following targets in setupdatabase.xml:
- Upgrade data configuration
- Initialization
- Configuration
- Generate upgrade DDL
- Apply User Defined Functions
- Schema upgrade
- Replace system name
- Optimize data instances
- Data upgrade
- Reset system name
- Run Upgrade Wizard for data schema
- Generate upgrade
- Cleanup
Upgrade data config
This step sets the properties required for the data-only upgrade process.
Initialization
This step creates the temp directory and checks whether enough space is available in the system before proceeding with the data-only upgrade. A minimum of 400 MB of space must be available for this process.
Configuration
This step generates configuration files, including prbootstrap.properties, prconfig.xml and prlogging.xml, that are used as part of the upgrade process.
Generate upgrade DDL
This step generates the SQL DDL statements for modifying the data schema. As a part of this process, all of the schema changes are applied between the versions that are upgraded to Pega 7.
All of the generated files are available in the following location:
\Pega 717 Distribution\schema\generated\oracledate
Apply User Defined Functions
This step adds the User Defined Functions (UDFs) into data schema. This is only required for unexposed columns (BLOB) reporting.
This step can by skipped by setting up the following property in setupdatabase.properties file.
Schema upgrade
This step applies the DDL generated from Step 4 - Generate upgrade DDL.
If the DDL is generated manually using the generateDDL utility, skip this step by setting the following property:
Replace system name
This step replaces the system name in the auto-generated prconfig.xml with the system name specified in the properties file.
The default system name in the setupdatabase.properties file is pega
.
Optimize data instances
If the application is upgraded from PRPC 6.3 SP1 or earlier, this step exposes the properties for the following classes so that the newly exposed columns are populated:
- Data-Admin-Nodes
- Data-Admin-System-Settings
- Data-AutoTest-Result-Suite
- Data-AutoTest-Result-Case
Data upgrade
This step imports the PRPC_Data.jar file into the data schema.
Reset system name
This step changes the prconfig file to use the prpc
system name.
Run Upgrade Wizard for data schema
This step is run irrespective of the below property if upgrading from versions PRPC 5.x and PRPC 6.x.
As a part of this process, the pzUpgradeDataSchema activity is invoked, which performs the following steps:
- If upgrading from PRPC 6.3 SP1 or earlier versions, Access Groups that reference PegaRULES directly are updated to reference the new PegaRULES Application version.
- If upgrading from PRPC 5.5 SP1 and earlier versions, Work Groups are validated and saved.
- If upgrading from PRPC 5.4 SP3 and earlier versions, correspondence and SLA instances are re-queued.
- If upgrading from PRPC 6.1 and earlier versions, instances of the PegaAccel and Data-Content-Image classes are migrated to their new tables.
Generate upgrade
If upgrading from PRPC 6.1 or earlier versions, this step exposes properties for the following migrated classes so that the newly exposed columns are populated, such as Data-Content-Image.
Cleanup
This step removes temporary directories and displays total runtime to upgrade data schema. It also breaks down the total runtime into various Ant Tasks.
All log files are collected and zipped into a single folder and saved at below location:
<PRPC_HOME>\scripts\logs\UpgradeDataSchema-CollectedLogs_YYYY-MM-dd_hh-mm-ss.zip