Back ForwardProduct Migration Command Line Utility

The Product migration command line utility is an enhancement to the existing UI based migration from within PRPC.

Prerequisites

The command line tool supports any Linux, UNIX, or Windows XP, Vista, or 7 operating system. It also supports Sun Java JDK version 1.5 or 1.6. Below, source refers to the PRPC instance from which a product is to be migrated and target refers to the PRPC instance to which the product is to be migrated.

Make sure you have the following details before starting migration:

  1. Collect the login details to log-in to both source and target systems. These users will be used to authenticate against both source and target systems and for invoking the services. Make sure these users have RAP export/import (zipMoveImport, zipMoveExport, SchemaImport if migrating schema changes) privileges.
  2. Add target system in source:
    1. Create Data-Admin-System-Targets instance on the source. Give the details of the target instance you are migrating to.
    2. User can configure the target from within PRPC or user can also use the Manage target system capabilities from the command line. But to use the command line utility to migrate products the targets have to be added from command line only. The reason for this being the UI option to add targets doesn’t support giving user and password details when adding the target but instead prompts for these details during migration.
    3. For more details on how to add targets from command line utility ref to addTaget action below.
  3. Configure PegaDiagnosticUser on source:
    1. Create an instance of Data-Admin-System-Security as PegaDiagnosticUser on the Source system. Specify the system granting the access as the source from which migration will be initiated.
    2. Add the same role/user in tomcat-users.xml.
      <role rolename="PegaDiagnosticUser"/>
      <user username="pega" password="pega" roles="PegaDiagnosticUser"/>

    3. Restart tomcat for the changes to take effect. This user is used by the target to authenticate and download the migration RAPs.

Note: The SourceHostName can only be a host name and should be accessible by its name and not only by its IP address.

Installation and Configuration

The utility is available in the productmigration.zip file in the ResourceKit folder on the distribution media. Follow the steps below to use it.

Step 1: Copy and Extract zip

Copy and extract the productmigration.zip file. The extracted folder structure should be like this:

Step 2: Set JAVA_HOME

Set JAVA_HOME environment variable to a valid Jdk5 or Jdk6 directory.

Step 3: Invoke the Utility

Depending on the environment being used run productMigration.bat/productMigration.sh to invoke any of the actions described in the following sections. User can invoke the utility by specifying the options in migration.properties or by using the command line arguments or even in mixed mode with some options specified in migration.properties and some supplied from the command line. The command line arguments take precedence over the properties specified in the properties file.

Utility Actions Available

The following section describes different actions than can be performed by the utility along with their usage.

Common Mandatory Options

To invoke any of the actions (except to get help), you need to set the following options. These options configure the system against which the utility will run the specified action. To support scripting, any of the actions can be invoked by specifying the options directly as named arguments from the command line. You can also invoke the utility by specifying the properties in migration.properties. The user can also run the utility by specifying some options in the properties file and some as named arguments directly.

Note: do not use "localhost" as the host name for part of a node URL. Using "localhost" will cause product migration to fail.

migration.properties

command line arguments

-url The SOAP servlet URL against which the action specified is run.
-user The user id available in the URL specified above with appropriate required privileges.
-pwd Password for the user.

The target action can be directly specified and is not a named argument.

Usage Example

./productMigration.sh <ACTION> –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install [Options]

Manage Target Systems

Options of this category allows the user to manage target system instances (Data-Admin-System-Targets). Below are relevant properties and their command line arguments to be configured for this category.

Migration.properties Command line argument Description
target.https -https Valid values are "true" or "false". If set to "true" use SSL security in the transfer.
target.host -host The name of the target PRPC server. This can be a server name or an IP address.
target.port -port The target server port number against which PRPC is running, such as "8080".
target.context -context The target server context root name, such as "prweb".
target.username -targUser A PRPC operator name of the target system which has import privileges.
target.password -targPwd Password of the specified PRPC operator

addTarget

This action adds a migration target to source system. Unlike migration from UI which allows specifying the target to migrate dynamically, the command line utility doesn’t support this and a target has to be first added before a migration request is initiated against it. A target is identified by its host name. The user cannot add two targets with the same hostname. If a target already exists the same target is overwritten with the new details provided.

The user specified in the target should have import privileges. And if https is set as true then SSL is used to download the product RAPs when migration is initiated.

All the options are mandatory.

Usage Example

./productMigration.sh addTarget –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –https false –host wponnsw7 –port 8080 –context prweb –targUser ponns –targPwd rules

editTarget

This action enables the changing of an already defined target. The target to be edited is identified by the hostname parameter. If the target doesn’t exist it returns the appropriate message and does not add a new target.

The host name followed by all the parameters for the host being changed are mandatory even though some of them are unchanged.

Usage Example

./productMigration.sh editTarget –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –host wponnsw7 –port 8181 –context prweb1 –https false –targUser ponns –targPwd rules

This should change the target wponnsw7’s port and context root leaving the remaining parameters as they were.

deleteTarget

Deletes the target from the host system as identified by the host name supplied. If the target is not found in the source, the appropriate message is returned.

Only the host parameter is mandatory.

Usage Example

./productMigration.sh deleteTarget –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –host wponnsw7

showTargets

This action lists all the targets available in the host system. No other arguments are required. Optionally the user can specify a target host and details of only that host will be returned.

Usage Example

This example lists all the targets added in the host.

./productMigration.sh showTargets –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install

The example below returns only the details of target wponnsw7 if present otherwise the appropriate message is returned.

./productMigration.sh showTargets –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –host wponnsw7

View Available Products

Options of this category enable users to view products.

showProducts

This action lists all the RAPs (Rule-Admin-Product) accessible to the user specified.

Usage Example

./productMigration.sh showProducts –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install

Migrate Products

Options of this category enable users to migrate products.

migration.properties

command line arguments

-targets Targets to which migration will happen. Multiple targets can be specified as a comma (,) separated list.
-products Products to be migrated. Multiple products should be comma (,) separated. For example, "prodName1:prodVersion1:prodPatch1,prodName2:prodVersion2:prodPatch3".

migrate

This action migrates the specified products to the specified targets from the source. Both the products and targets must be defined before invoking this action. At least one target and one product must be specified.

Usage Example

./productMigration.sh migrate –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –targets serverName1,serverName2 –products sample:01-01-01,test:01-01-01

If using the properties file in addition to the mandatory parameters the hosts and products can be specified like this:

migrate.target.host_1= serverName1
migrate.target.host_2= serverName2
migrate.product_1=sample:01-01-01
migrate.product_2=test:01-01-01-01

In which case sample:01-01-01 will be imported first followed by test:01-01-01.

Get Status/Abort Migration request

Options of this category enable users to get the status of or abort migration requests.

migration.properties

command line arguments

-workCoverID Specify the work cover id of the migration request to abort.

abort

This action attempts to abort the migration request in progress. This does not abort an import in progress but instead stops the migration request from importing any more products.

Usage Example

./productMigration.sh abort –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –workCoverID pxMigReq-53

getMigrationLog

This action returns the summary log along with the status of the migration at each of the targets against which migration was initiated. If work cover id is not specified it returns the summary log for the last migration request initiated.

Usage Example

./productMigration.sh getMigrationLog –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –workCoverID pxMigReq-53

Download Detailed Import Log

Options of this category enable downloading of detailed logs.

migration.properties

command line arguments

targetWorkObjID This represents the work object id of the migration request on the target system. This can be identified from migration log.

getImportLogs

This action downloads the detailed import logs of the products migrated to the target system. To get the logs of a particular request user should specify the workobject id the same can be obtained from the summary log by invoking the getMigrationLog action against the source. If no work object id is specified it returns the log of the last migration request available on the target. Note the change in the node url as it should now point to the target as this is an action against target. And the user/pwd should also be one of the users in target instance.

Usage Example

./productMigration.sh getImportLogs –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user tester –pwd rules –targetWorkObjID pxMigReq-53

Usage Help

User can get the help from the command line. The help option gets the complete list of all the available actions and arguments available for each of them. Just invoke the utility with help as the argument to get help.

Usage

./productMigration.sh help

Limitations

The abort action does not actually abort the in progress migration request but instead it prevents further imports to the same target if multiple targets are being migrated as part of a single migration request.

Related topics

About the Application Packaging wizard

UpAbout the Product Migration wizard