Overview
ExportImportPolicyPackage tool enables you to export a policy package from a R80.x management database to a .tar.gz file, which can then be imported into any other R8x management database.
This tool can be used for backups, database transfers, testing, and more.
In the case you are exporting a policy package from a CMA, please verify that a global policy was NOT assigned to that CMA.
The tool doesn't support exporting a policy with global policy assigned!
The tool is referenced in https://support.checkpoint.com/results/sk/sk180923
Description
This tool enables you to export a policy package (Access Policy, Threat Policy or both) from a management server into a .tar.gz file.
Notice
There are some types of objects that the script might not be able to export.
In such a case, an appropriate dummy object will be exported instead, and a message will be logged into the log files to notify you of this.
In the Check Point SmartConsole you can easily replace each of these objects by searching "export_error" in the search field, see where each object is used, create the necessary object manually, then replace it.
Instructions
Download the latest version from our GitHub repository: https://github.com/CheckPointSW/ExportImportPolicyPackage
First, make sure you have [2.7.9 <= Python <= 2.7.14] installed on the machine running the script.
To export a package, run the import_export_package.py script. An interactive menu will guide you the rest of the way.
Command line flags may also be set in order to skip some or all of the menu.
A lot more details can of course be accessed with the [-h] option. This option also prints the current version of the tool.
Current tool version is V3.0.
Limitations
This export/import script does not gather all data from a given management server/CMA.
In general, it is limited by the R80.x Management APIs.
Specifically, this means:
- CMAs with a Global Policy assigned cannot be exported
- Workaround: unassign the Global Policy prior to export
- Gateway/Cluster objects have to be recreated
- Placeholder objects will be created
- UserCheck messages have to be recreated
- Placeholder objects will be created
- The Internal Certificate Authority will not be copied. This means:
- Re-establishing SIC with the appropriate gateways
- Re-generating VPN certificates
- Manually recreating HTTPS Inspection and DLP Rules
- Other objects not currently readable/writable via the R80.x API will not be copied
Tested on version
R8x
Releases earlier than R80 lack the necessary API support and are not supported.
Source Code Availability
The source code is available through GitHub: https://github.com/CheckPointSW/ExportImportPolicyPackage
FAQ
Replies to this thread have locked.
Please refer to the FAQ below before you create a new post with your question.
When I run this tool, I get the message: APIResponse received a response which is not a valid JSON.
This most likely means you haven't enabled the API server yet.
See: https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Enabling-web-api/m-p/32641
I get an error message related to server fingerprint
Use the --unsafe option to ignore this error.
Can this tool export more than one policy package at a time?
Not currently, but you could call the tool in a script multiple times.