Often you find scenarios where you may want to migrate the running instances in one revision to another. A very common example for this is when you make some critical changes in your process, and you want all the older, already started but running instances, to continue in this new revision.
In such cases, the ant script ant-composite-instance-migration.xml will come handy
Location : <ORACLE_HOME>/bin/ant-composite-instance-migration.xml
Please note that this file has some errors in the jar locations, so cross-verify.
Create a build script for using this ant file. You need to provide the following information
1. Server details
2. Source Revision
3. Target Revision
Here's my build.xml file
--------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="migration-approvalProcess-straightMigration">
<!--
CREATE/MODIFY THE FOLLOWING
===========================
ENVIRONMENT VARIABLE ORACLE_HOME
REPORTS DIRECTORY VALUE
SERVER DETAILS IN <locatorConfig>
SOURCE COMPOSITE REVISION AND FILTER CONDITIONS IN <compositeInstanceFilterDef>
TARGET COMPOSITE REVISION IN <generateMigrationReport> AND <migrateCompositeInstances>
NOTE : MIGRATION PLAN IS NOT REQUIRED FOR MIGRATION FLAGGED AS AUTOMATIC
-->
<property environment="envVar"/>
<property name="srcBpmRevision" value="1.0"/>
<property name="targetBpmRevision" value="2.0"/>
<import file="${envVar.ORACLE_HOME}/bin/ant-composite-instance-migration.xml"/>
<property name="reports.dir" value="${basedir}/MigrationReports"/>
<!-- SERVER CONNECTION DETAILS -->
<locatorConfig id="c1" host="asdf.abc.com" port="10030" user="userid" password="pwd"/>
<target name="migrateCompositeInstances">
<compositeInstanceFilterDef id="f1" domainname="default" compositedn="default/ApprovalProcess_InstanceMigration!${srcBpmRevision}" compositeinstanceid="2410732"/>
<locatorSession configid="c1">
<generateMigrationReport filterid="f1" revision="${targetBpmRevision}" outputfile="${reports.dir}/MigrationFeasibilityReport_AutomaticMigration_${srcBpmRevision}.xml"/>
<!-- Migration Plan is not required for automatic migration -->
<migrateCompositeInstances filterId="f1" revision="${targetBpmRevision}" outputFile="${reports.dir}/MigrationResultReport_AutomaticMigration_${srcBpmRevision}.xml"/>
</locatorSession>
</target>
</project>
--------------------------------------------------------------------------------------------------------------------
Understanding the build file
compositeInstanceFilterDef : Filter for what instances to migrate. You can use various filter attributes like
id*, compositeDN*, flowId, pageStart, pageSize, tenantId, maxCreationDate, minCreationDate, maxModifyDate, minModifyDate, like, ecid, conversationId, compositeName, domainName, label, revision, title (* - Mandatory)
generateMigrationReport : This generates a report with the migration feasibility. It is a good practice to run only this first, analyse the report and then run the actual migration
migrateCompositeInstances : This runs the migration
Note that for those instances where the migration is marked as 'automatic' in the feasibility report do not require a migration plan, they can straight away be migrated.
In such cases, the ant script ant-composite-instance-migration.xml will come handy
Location : <ORACLE_HOME>/bin/ant-composite-instance-migration.xml
Please note that this file has some errors in the jar locations, so cross-verify.
Create a build script for using this ant file. You need to provide the following information
1. Server details
2. Source Revision
3. Target Revision
Here's my build.xml file
--------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="migration-approvalProcess-straightMigration">
<!--
CREATE/MODIFY THE FOLLOWING
===========================
ENVIRONMENT VARIABLE ORACLE_HOME
REPORTS DIRECTORY VALUE
SERVER DETAILS IN <locatorConfig>
SOURCE COMPOSITE REVISION AND FILTER CONDITIONS IN <compositeInstanceFilterDef>
TARGET COMPOSITE REVISION IN <generateMigrationReport> AND <migrateCompositeInstances>
NOTE : MIGRATION PLAN IS NOT REQUIRED FOR MIGRATION FLAGGED AS AUTOMATIC
-->
<property environment="envVar"/>
<property name="srcBpmRevision" value="1.0"/>
<property name="targetBpmRevision" value="2.0"/>
<import file="${envVar.ORACLE_HOME}/bin/ant-composite-instance-migration.xml"/>
<property name="reports.dir" value="${basedir}/MigrationReports"/>
<!-- SERVER CONNECTION DETAILS -->
<locatorConfig id="c1" host="asdf.abc.com" port="10030" user="userid" password="pwd"/>
<target name="migrateCompositeInstances">
<compositeInstanceFilterDef id="f1" domainname="default" compositedn="default/ApprovalProcess_InstanceMigration!${srcBpmRevision}" compositeinstanceid="2410732"/>
<locatorSession configid="c1">
<generateMigrationReport filterid="f1" revision="${targetBpmRevision}" outputfile="${reports.dir}/MigrationFeasibilityReport_AutomaticMigration_${srcBpmRevision}.xml"/>
<!-- Migration Plan is not required for automatic migration -->
<migrateCompositeInstances filterId="f1" revision="${targetBpmRevision}" outputFile="${reports.dir}/MigrationResultReport_AutomaticMigration_${srcBpmRevision}.xml"/>
</locatorSession>
</target>
</project>
--------------------------------------------------------------------------------------------------------------------
Understanding the build file
compositeInstanceFilterDef : Filter for what instances to migrate. You can use various filter attributes like
id*, compositeDN*, flowId, pageStart, pageSize, tenantId, maxCreationDate, minCreationDate, maxModifyDate, minModifyDate, like, ecid, conversationId, compositeName, domainName, label, revision, title (* - Mandatory)
generateMigrationReport : This generates a report with the migration feasibility. It is a good practice to run only this first, analyse the report and then run the actual migration
migrateCompositeInstances : This runs the migration
Note that for those instances where the migration is marked as 'automatic' in the feasibility report do not require a migration plan, they can straight away be migrated.
Could you please explain how to create migration plan as running the script throws an error -
ReplyDeleteCaused by: java.io.FileNotFoundException: /media/sf_SHARED/instances_migration_scripts/scripts/MigrationReports/MigrationFeasibilityReport_AutomaticMigration_1.0.xml (No such file or directory)
Seems like the issue is with the file location. Check the relative path properly or give absolute path and try.
Delete