CPM to RM relational database migration
The migration of CPM data to the new RM schema is executed on database level via a prepared SQL script.
Please note: Not all rules can be migrated to RM, since the functionalities of Rules Management do not match with CPM Rules exactly.
It is possible to check which rules can not be migrated after executing migration scripts, for details: Feature gap between CPM Rules and Rules Management
Prerequisites
Before the actual data migration can start, the following tables need to be cloned manually from the source database (CPM) to the target database (RM):
-
RS01_RULE
-
RS02_PARAMETER
-
RS03_DECISION
-
RS04_ACTION
-
RS05_EXPRESSION
-
RS06_RULE_HISTORY
-
RS07_FUNCTION
-
RS08_OPERATOR
-
RS09_CONTEXT
-
RS11_RULE_CONTEXT
-
RS12_FUNCTIONAL_ARGUMENT
-
RRS01_RULE_RESULT_TIMER
Performing the data migration
-
Connect to the RM database
-
Open the relevant migration script according to database vendor ("cpm-rules-to-rm-migration.sql") located in shared folder:
\\rb-repobci.de.bosch.com\InternalShare\IAS\IAS2023.02\MigrationCPMToCM\RM -
Copy the script ("cpm-rules-to-rm-migration.sql")
-
Define RULE_MANAGEMENT_LIGHT_ENABLED flag in script accordingly → set to 1 to enable rules light migration, set to 0 to enable rules extended (Kafka)
-
Execute the script against the database
-
Migrated data will be committed only when the script is executed successfully. In case of any failure, no data will be migrated. Please reach out to the third level support (Dev team) in this case.
Post migration
Important: When the migration has completed successfully, please do NOT delete the cloned tables! They should be kept to preserve the old CPM Rules configuration as a backup for any future reference; since not all rules can be migrated as mentioned, details can be found in here.
Feature gap between CPM Rules and Rules Management
To get an overview of rules which were not migrated to RM, you can execute the script "migration-delta-report.sql" according to database vendor located in shared folder:
\\rb-repobci.de.bosch.com\InternalShare\IAS\IAS2023.02\MigrationCPMToCM\RM
The script will output one row per defined condition, i.e. a rule with two conditions will appear in two rows.
-
Since time-based (previous values) type is not available in Rules Management light, the whole rule is not migrated to RM
-
RRS01_RULE_RESULT_TIMER is not migrated since equipment state (line cockpit) is not part of CM currently
-
CRON_EXPRESSION in RS01_RULE is migrated, however there is currently no functionality using this data in RM
-
Custom functions is not migrated since external functions in RM use a different concept (external functions)
-
USER_ID in RS06_RULE_HISTORY is not migrated since it is not available in RM
-
Since not all functions are available in RM Light or RM Extended, unavailable rules are not migrated to RM. The detailed information regarding function availability can be found below:
| Function Name | Existing in CPM | CPM Function Name in DB | Existing in RM Extended | Existing in RM Light | RM Function Name in DB |
|---|---|---|---|---|---|
Upper bound function |
yes |
upperBound |
yes |
yes |
upperBound |
Lower bound function |
yes |
lowerBound |
yes |
yes |
lowerBound |
Upper bound function, check newest measurement first |
no |
yes |
yes |
upperBoundCheckNewestFirst |
|
Lower bound function, check newest measurement first |
no |
yes |
yes |
lowerBoundCheckNewestFirst |
|
Upper/Lower bound function with calculated limits using threshold from Measurement message |
no |
yes |
no |
upperBoundCalculatedLimits |
|
Upper/Lower bound function with threshold from Measurement message |
yes |
limitOffsetNew |
yes |
yes |
upperLowerBoundPpmpThreshold |
Event Sequence Detection |
yes |
eventSequenceDetection |
yes |
no |
eventSequenceDetection |
Hit of events function |
yes |
hitsOfEvents |
yes |
yes |
hitOfEvents |
Jump detection function |
no |
yes |
no |
jumpDetection |
|
Jump detection function (different jump calculation) |
yes |
jumpDetection |
yes |
yes |
jumpDetectionStandardDeviation |
Process capability index function |
yes |
processCapabilityIndex |
yes |
no |
cpk |
Trend (method of least squares, normalized/timeBased) function |
yes |
|
yes |
no |
trendDetectionOld |
Trend detection function |
no |
no |
no |
trendDetection |
|
Dynamic Limit function |
yes |
dynamicLimit |
no |
no |
|
Nelson rule one function |
yes |
nelsonRuleOne |
no |
no |
|
Nelson rule two function |
yes |
nelsonRuleTwo |
no |
no |
|
Nelson rule three function |
yes |
nelsonRuleThree |
no |
no |
|
Nelson rule four function |
yes |
nelsonRuleFour |
no |
no |
|
Nelson rule five function |
yes |
nelsonRuleFive |
no |
no |
|
Nelson rule six function |
yes |
nelsonRuleSix |
no |
no |
|
Nelson rule seven function |
yes |
nelsonRuleSeven |
no |
no |
|
Nelson rule eight function |
yes |
nelsonRuleEight |
no |
no |
|
Normal distribution function |
yes |
normalDistribution |
no |
no |
|
Range function |
yes |
Range |
no |
no |
|
Static tolerance check function |
yes |
staticTargetToleranceCheck |
no |
no |