Product Migration Command Line Utility
|
The Product migration command line utility is an enhancement to the existing UI based migration from within PRPC.
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:
Add the same role/user in tomcat-users.xml.
<role rolename="PegaDiagnosticUser"/>
<user username="pega" password="pega" roles="PegaDiagnosticUser"/>
Note: The SourceHostName can only be a host name and should be accessible by its name and not only by its IP address.
The utility is available in the productmigration.zip file in the ResourceKit folder on the distribution media. Follow the steps below to use it.
Copy and extract the productmigration.zip file. The extracted folder structure should be like this:
Set JAVA_HOME environment variable to a valid Jdk5 or Jdk6 directory.
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.
The following section describes different actions than can be performed by the utility along with their usage.
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.
-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.
./productMigration.sh <ACTION> –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install [Options]
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 |
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.
./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
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.
./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.
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.
./productMigration.sh deleteTarget –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –host wponnsw7
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.
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
Options of this category enable users to view products.
This action lists all the RAPs (Rule-Admin-Product) accessible to the user specified.
./productMigration.sh showProducts –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install
Options of this category enable users to migrate products.
-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". |
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.
./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.
Options of this category enable users to get the status of or abort migration requests.
-workCoverID | Specify the work cover id of the migration request to 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.
./productMigration.sh abort –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –workCoverID pxMigReq-53
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.
./productMigration.sh getMigrationLog –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user [email protected] –pwd install –workCoverID pxMigReq-53
Options of this category enable downloading of detailed logs.
targetWorkObjID | This represents the work object id of the migration request on the target system. This can be identified from migration log. |
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.
./productMigration.sh getImportLogs –url http://<serverName>:<portName>/prweb/PRSOAPServlet -user tester –pwd rules –targetWorkObjID pxMigReq-53
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.
./productMigration.sh help
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.