A very short introduction to Python syntax. These examples are from SMS to domain migration. When exporting from MDS domain you will need to reference to that domain.
First of all you'll need to get the name of the policy you want to export if you have a lot of them.
List all policies with mgmt API (need to use the domain keyword to export from a CMA)
mgmt_cli --root true --format json show packages | jq ".packages[] .name" -r
Copy the Python SDK to your management server and use the following command to reference to it:export PYTHONPATH=${PYTHONPATH}:/home/admin/python/cp_mgmt_api_python_sdk-master/
Run Import_export_package (this is a menu driven tool) to export the package
/opt/CPsuite-R80.20/fw1/Python/bin/python2.7 /home/admin/python/ExportImportPolicyPackage-master/import_export_package.py
Copy package to the destination and import it automatically without prompting
/opt/CPsuite-R80.20/fw1/Python/bin/python2.7 /home/admin/python/ExportImportPolicyPackage-master/import_export_package.py --file /home/admin/Internal_Prod/exported__package__POLICY_NAME__DATE.tar.gz --domain x.x.x.x --root --unsafe-auto-accept