Exporting rules and data by submitting a request to an active instance
You can automate exporting rules and data to an archive by connecting to an active instance of Pega Platform from a web service. One request can export rules and data to one archive file from one system. You can export by product, application, or branch.
- Configure the common properties in the prpcServiceUtils.properties
file.
Property name Value pega.rest.server.urlThe URL for the REST service, specified in the following format: http://<hostname>:<port>/<context>/PRRestService/For example:
http://myhost:8080/prweb/PRRestServicepega.rest.usernameThe operator name on the target system with access to REST services. pega.rest.passwordThe password of the specified operator. pega.rest.proxy.hostOptional: The host name of the REST proxy server. Do not use localhost as the host name. pega.rest.proxy.portOptional: The port for the REST proxy server. pega.rest.proxy.usernameOptional: The operator name on the REST proxy server with import and export access. pega.rest.proxy.passwordOptional: The password of the REST proxy operator. pega.rest.proxy.domainOptional: The domain of the REST proxy server. pega.rest.proxy.workstationOptional: The workstation ID for the REST proxy server. pega.rest.response.typeThe REST response type, either xmlorjson. The default value isjson. Rollback, restore point, and update access group operations support onlyjson.user.temp.dirOptional: Enter the full path to the temporary directory. Leave this blank to use the default temporary directory. For more information about temporary directories, see Temporary files and temporary files directories . - Specify the archive file name or repository name, and whether to export in asynchronous
mode:
Property name Value export.exportToRepositoryIndicates whether to export to a repository. The default is false, which exports to a file system. To export to a repository, set this totrue.export.archiveNameWhen exporting to a file system, the path of the archive file to be created. export.repositoryNameWhen exporting to a repository, the name of the repository. export.asyncSpecifies whether to run the process in asynchronous mode or synchronous mode. The default, true, is asynchronous, which returns a job ID that you can use later to check the job status. When this value isfalse, the process starts immediately and waits until completion. The choice of synchronous or asynchronous depends on the type of script you are writing. - To export by product, specify the product name and version:
Property name Value export.productNameThe name of the product to export. export.productVersionThe version of the product to export. - To export by application, specify an application name and
version:
Property name Value export.applicationVersionThe version of the application to export. export.applicationNameThe name of the application to export. - To export by branch, specify a branch name and application
context:
Property name Value export.branchNameThe name of the branch to export. export.branchAppContextThe application context of the branch ruleset to export, for example, PegaRULES:07.10 - Save and close the prpcServiceUtils.properties file.
-
Run the prpcServiceUtils.bat script or the prpcServiceUtils.sh script with the export option, for example:
prpcServiceUtils.bat exportOptional: Pass one or more arguments.
prpcServiceUtils script argument Value artifactsDirThe full path to the output file location, for those functions that generate output. The default is the /scripts/utils/logs directory. connPropFileThe full path to the serviceConnection.properties file that includes information for multiple targets. poolSizeThe thread pool size. The default is 5. requestTimeOutThe number of seconds the system waits for a response before failing with a time-out error. The default is 300 seconds. jobIdFileThe path to the job IDs file that is generated by the asynchronous operation. propFileThe property file name, to override the default prpcServiceUtils.properties file. operationNameSpecify the operation that generated the job ID for getStatus: import,export,expose,hotfix, orrollback.
Pega Platform downloads the exported archive file and saves the export log files to the logs directory. For more information about logs, see the Pega Community article Pega Platform logging using Log4j 2.