Question

Importing multiple ruleset zip files to multiple db environments using prpcUtils scripts

Hi Team,

I have a question regarding importing ruleset zip files through command line using prpcUtils.sh script and prpcUtils.properties.

If I have to import a rulesetA1.zip file, I will specify the db driver class, jar, and connection properties and will feed in the full path for rulesetA1.zip file in the prpcUtils.properties.

"import.archive.full.path=C:\rulesetA1.zip"

As I'm on PRPC 6.1 SP2 system as per the below link - I will run the command as > prpcUtils.bat importPegaArchive

https://pdn.pega.com/system-operations/how-to-import-or-export-an-archive-from-the-command-line

Question 1: Is there a way that will allow us to import multiple zip files like 15-20 zip files to DB using the above approach without manually updating the properties file before each execution run ?

Questions 2: If there are three DB environments for which I need to perform import, Do I need to have three prpcUtils.properties files ?

***Updated by moderator: Lochan to close 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.

Correct Answer
July 16, 2015 - 5:20am

Hi Harish,

Question 1: Is there a way that will allow us to import multiple zip files like 15-20 zip files to DB using the above approach without manually updating the properties file before each execution run ?

Yes we have to manually update the properties file to import multiple files. But this has been enhanced in latest by placing all the jar files into a folder and giving the import path to that folder.

Questions 2: If there are three DB environments for which I need to perform import, Do I need to have three prpcUtils.properties files ?

And Yes again we have to maintain three properties files for each DB you want to import. Alternatively we can use the procedure mentioned by Celeste Dufresne in above comments.

Comments

Keep up to date on this post and subscribe to comments

July 15, 2015 - 11:08am

I'm assuming your zip was generated by the make-product-file button on a rule-admin-product, correct ?

Is it possible to modify the rule-admin-product so that instead of generating 20 zips, you generate one zip containing all the rules ?

If not, I would suggest you peek at the prpcutils.bat file itself to see how it uses the import.archive.full.path  to see if it would be simple to modify the bat file to loop over a list of zips given in that path.

/Eric

July 15, 2015 - 11:54am

I am not sure if it is available in 6.1sp2 but certainly in later versions you can use a comma seperated list of RAP files that you want to import.  Since this version is still making you specify which type of archive you are importing instead of letting the tool figure out the import type that would only work if all of your archives were of the same type.  You can also pass any of these as command line arguments so you wouldn't need to use the properties file at all.

echo usage:

echo prpcUtils.bat ( export ^| exportRAP ^| importPegaArchive ^| importCodeArchive ^| importAppBundle ^| expose ^| resave ^| help ) [options...]

echo.

echo Options:

echo   --driverClass  Your JDBC driver class (example: oracle.jdbc.OracleDriver)

echo   --driverJAR    Location of your JDBC JAR file

echo   --dbType       Database vendor type ("mssql" for SQL Server, "udb" for DB/2 UDB, "oracledate" for Oracle)

echo   --dbURL        JDBC URL to db to be loaded

echo   --dbUser       Database username

echo   --dbPassword   Database password

echo   --archivePath  Full path to the archive to be imported or exported

echo   --udbSchema    Sets the schema for UDB

echo All "--" options are optional and will override options in the properties file

Pega
July 16, 2015 - 5:20am

Hi Harish,

Question 1: Is there a way that will allow us to import multiple zip files like 15-20 zip files to DB using the above approach without manually updating the properties file before each execution run ?

Yes we have to manually update the properties file to import multiple files. But this has been enhanced in latest by placing all the jar files into a folder and giving the import path to that folder.

Questions 2: If there are three DB environments for which I need to perform import, Do I need to have three prpcUtils.properties files ?

And Yes again we have to maintain three properties files for each DB you want to import. Alternatively we can use the procedure mentioned by Celeste Dufresne in above comments.

September 2, 2015 - 5:57am
Response to kothn1

Hi Nekhil,

Yes we have to manually update the properties file to import multiple files. But this has been enhanced in latest by placing all the jar files into a folder and giving the import path to that folder.

Could you please more specific?

We need to batch import dozens of archived files into another database, Please kindly advise.

Thanks very much.

Pega
September 2, 2015 - 6:04am
Response to GAVINHSU

Which version of PRPC you are trying to import into?

Thanks,

Nekhil Kotha

September 2, 2015 - 6:12am
Response to kothn1

Hi Nekhil,

The version of PRPC is 6.1 SP2.

Thanks.

Pega
September 2, 2015 - 6:21am
Response to GAVINHSU

Hi Gavin,

If you are on 6.1 SP2 then you have to manually edit the properties file for each archive you want to import and run the import process.

But in latest versions it has been modified to accept the folder which contains JARS to be imported by specifying path to folder instead of path to specific JAR. It will import all the files present in that folder.

import.archive.path=E:\path\to\folder

Thanks,

Nekhil Kotha

September 7, 2015 - 4:08am
Response to kothn1

Thanks Nekhil.

I have write a shell script to list all zip files in specified directory, and call "./prpcUtils.sh importPegaArchive --archivePath /test_zips/zipname.zip" iterate.

Although, some of the steps have to be ran duplicated; the batch process has already ran for couple of hours, seems it works fine.

Thanks for your kindly reply anyway.

December 23, 2015 - 4:01am
Response to kothn1

Questions 2: If there are three DB environments for which I need to perform import, Do I need to have three prpcUtils.properties files?

For this.... We can create a parametrized script which can read DB details of Various environments from a file. Using if else or switch case, we can read only particular DB details and we can pass those DB values to prpcUtils.properties file in runtime.

In this case we can have one prpcUtils.property file .

Note: Before invoking the prpcUtils.sh script, the property file should contain Valid DB details in order to proceed with import.

September 2, 2015 - 12:15pm

In 6.1sp2, can we specify the parameter on the command line instead of in the properties file ?  if so, then by taking a directory of the jar files and then editing the output to change it into a list of import commands, then that may do the trick.  /Eric

September 7, 2015 - 4:10am
Response to ericosman_GCS

Hi Eric,

Actually, the file to be imported can be set in parameter instead of properties file.

The problem is that it can only take file as parameter, not directory.

./prpcUtils.sh importPegaArchive --archivePath /test_zips/zipname.zip

November 4, 2016 - 6:19am

Hi,

when i gave multiple RAP file paths to the ./prpcUtils.sh importPegaArchive --archivePath /test_zips/zipname.zip,/test_zips/zipname1.zip,/test_zips/zipname2.zip 

like this, I have facing that those RAP are not followed the order given , those are imported randomly.

Can u suggest what the approach has to follow to get the correct order.

Mod
November 11, 2016 - 5:50am
Response to venug724

Hi Venu,

To get your question more visibility, we have created a new post for you! Please update that and continue your discussion. 

Importing multiple RAP files in the sequence defined

Hope to see you around the Community!
Lochan  |  Community Moderator  |  Pegasystems Inc.

Lochana | Community Moderator | Pegasystems Inc.