Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
AshleyM
Participant

Migrate Policies & Objects

Hi All,

 

I am looking for the best way to export all objects and policies from an R80 management server so that it can be imported into another R80 management server. I've been looking at the management API reference guide which has helped but I was wondering if anyone is aware of a script that will cover both objects and policies?

 

Thanks

0 Kudos
10 Replies
G_W_Albrecht
Legend Legend
Legend

        Python tool for exporting/importing a policy packa...               

CCSP - CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
AshleyM
Participant

Thank you, this looks like what I need. I'm having some trouble installing the Python SDK as the commands 'pip' and 'git' do not work on the management server. Have you installed this before? If yes, would you mind sharing how you went about this?

0 Kudos
G_W_Albrecht
Legend Legend
Legend

https://community.checkpoint.com/t5/API-CLI-Discussion/Checkpoint-Python-SDK/m-p/96533#M5148

 

CCSP - CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
AshleyM
Participant

Thank you, I have got the scripts installed now. I did this by unzipping the files on my PC and then using SFTP to place the files in the /home/admin/ directory. 

When I run the script I am being asked to enter the Policy Package name, I have entered the correct policy name however I get the below error. Can anybody see what I am doing wrong?

 

"[Expert@fwmgmt02:0]# /opt/CPsuite-R81/fw1/Python/bin/python2.7 /home/admin/ExportImportPolicyPackage/import_export_package.py

Welcome to the Policy Package Import/Export Tool.
What would you like to do?
1. Import a package
2. Export a package
99. Exit
2
Please enter a Policy Package name to export:
West_Policy
Traceback (most recent call last):
File "/home/admin/ExportImportPolicyPackage/import_export_package.py", line 26, in <module>
args = process_arguments(arg_parser)
File "/home/admin/ExportImportPolicyPackage/utils.py", line 98, in process_arguments
args = Menu(args).self_args
File "/home/admin/ExportImportPolicyPackage/menu.py", line 21, in __init__
self.build()
File "/home/admin/ExportImportPolicyPackage/menu.py", line 146, in build
self.display()
File "/home/admin/ExportImportPolicyPackage/menu.py", line 30, in display
self.handle_input()
File "/home/admin/ExportImportPolicyPackage/menu.py", line 269, in handle_input
self.build()
File "/home/admin/ExportImportPolicyPackage/menu.py", line 146, in build
self.display()
File "/home/admin/ExportImportPolicyPackage/menu.py", line 30, in display
self.handle_input()
File "/home/admin/ExportImportPolicyPackage/menu.py", line 167, in handle_input
self.self_args.name = input()
File "<string>", line 1, in <module>
NameError: name 'West_Policy' is not defined"

0 Kudos
PhoneBoy
Admin
Admin

The error is there at the end: name 'West_Policy' is not defined.
Which probably means the real name of the policy package is different.
Use mgmt_cli -r true show packages to make sure you have the precise name of the package correct.

 

0 Kudos
Rohit_Raut
Participant

Try different Python version (Python3 or Python 3.7). Python 3 worked for me.

0 Kudos
the_rock
Legend
Legend

I actually had same issue even after following the instructions. Will attempt again tomorrow.

0 Kudos
the_rock
Legend
Legend

Personally, I always use migrate export for that and it exports everything. objects and policies.

0 Kudos
AshleyM
Participant

I realise I didn't mention that I'm trying to import the objects into an existing active management server, migrate export would wipe the current database & replace it. I'm trying to merge the databases essentially.

0 Kudos
the_rock
Legend
Legend

K, I see, so then my suggestion would not work, apologies. You could also consider below:

https://community.checkpoint.com/t5/API-CLI-Discussion/CLI-API-Example-for-exporting-importing-and-d...

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events