How to import or export an archive from the command line
You can export and import PegaRULES .zip archives by using a command-line utility. Exporting PegaRULES .zip archives from one system and importing them to another is useful for keeping multiple systems in sync and for restoring a ruleset version that has been deleted by mistake.
You can also schedule a process that runs at a specified time to automatically import or export an archive. For example, if you have two Pega 7 Platform systems that must be kept in sync, you can export from one system and import the resulting archive to the second system by using a custom script.
For instructions about how to import and export PegaRULES .zip archives prior to PRPC 6.1, see How to import and export .zip archives from a command line.
To import and export PegaRULES .zip archives, do the following tasks:
- Edit the database connection properties
- Configure and run the import tool
- Configure and edit the export tool
Editing the database connection properties
- Extract the contents of the Pega 7 Platform software distribution .zip file, PRPC_DistributionImage.zip, into a directory (referred to as <PEGA_HOME> in this example).
- In the <PEGA_HOME>/scripts/utils directory, open the prpcUtils.properties file, and edit the following database connection details in the COMMON PROPERTIES - DB CONNECTION (REQUIRED) section:
- pega.jdbc.driver.jar – The full path to the JDBC driver JAR file.
- pega.jdbc.driver.class – The Java class name of the JDBC driver.
- pega.database.type – Select the database vendor from the list of supported vendors.
- pega.jdbc.url – The connection URL for your database. Refer to the examples in the prpcUtils.properties file.
- pega.jdbc.username and pega.jdbc.password – The user name and password to use when connecting to your database.
Sample connection parameters
Configuring and running the import tool
- In the <PEGA_HOME>/scripts/utils directory, open the prpcUtils.properties file and edit the SETTINGS FOR IMPORT TOOL section with the properties that apply to your import. For a description of the import properties, see prpcUtils properties and arguments.
- Optional: If your import must be performed as a particular user, set the pega.user.username and pega.user.password properties.
- From the command prompt, go to the <PEGA_HOME>/scripts/utils directory and run the prpcUtils.bat or prpcUtils.sh script:
- For PRPC 6.3 or later, use the argument
import
- For PRPC 6.1-6.2, use one of the following arguments:
importPegaArchive
– To import rule instances into the systemimportCodeArchive
– To import code instances into the systemimportAppBundle
– To import an application bundle into the system
- For PRPC 6.3 or later, use the argument
- Review the log files in the <PEGA_HOME>/scripts/utils/logs directory to ensure that the import was successful.
Configuring and editing the export tool
- In the <PEGA_HOME>/scripts/utils/ directory, open the prpcUtils.properties file and edit the SETTINGS FOR EXPORT TOOL section with the properties that apply to your import. In this example, the rules in the ruleset versions GlobexInsurance:01-02-01 through GlobexInsurance:01-02-04 are included in the .zip archive.
Sample export configuration - From the command prompt, go to the <PEGA_HOME>/scripts/utils directory and run the prpcUtils.bat or prpcUtils.sh script.
- Review the log files in the <PEGA_HOME>/scripts/utils/logs directory to ensure that the export was successful.