[java] at com.pega.pegarules.install.SQLLoader.fail(SQLLoader.java:359)
[java] at com.pega.pegarules.install.SQLLoader.main(SQLLoader.java:316)
During the DataOnly upgrade, the Upgrade Script generate and apply many DDL SQL statements for data schema, among those there is one statement which create Primary key constrain in the pr4_log_rule_usage table in the data schema.
The statement is like below
ALTER TABLE <data schema>.pr4_log_rule_usage ADD CONSTRAINT pr4_log_rule_usage_PK PRIMARY KEY (pzInsKey);
we were getting “cannot validate (******.PR4_LOG_RULE_USAGE_PK) - primary key violated” error while running below statement and data only upgrade was failing, because in the Data schema which was copied from the existing 6.x environment, the table PR4_LOG_RULE_USAGE already contain some duplicate records which was not allowing to create primary key.
We deleted duplicate records from the table PR4_LOG_RULE_USAGE. Once done we executed dataOnly upgrade again and it got executed successfully.
So it is recommended that in Lift and Shift approach, as pre upgrade steps truncate the PR4_LOG_RULE_USAGE table.
Truncating this table before the running of upgrade script will not be an issue, because this table does not holds any business transaction, this table holds statistics collected during system shutdown about cumulative rule execution statistics associated with theLog-RuleUsage class
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.