Example

This example explains Ranger policy migration tool.

Example

  1. Upsert policies from repo hdp_hdfs to repo cm_hdfs (Recommended). The `-t` and `-f` repositories must be of the same type. ./ranger_policy_migration.py -u http://my_ranger.server.org:6080 -n admin -p admin -f hdp_hdfs -t cm_hdfs This matches and updates the policies in the to repository with the ones in the from repository. Matching is done based on the resource path. Whenever a matching policy is not found, it creates a new policy.
  2. Move policies between repositories with the `-m` option. The `-t` and `-f` repositories must be of the same type. ./ranger_policy_migration.py -u http://my_ranger.server.org:6080 -n admin -p admin -f hdp_hdfs -t cm_hdfs -m m
  3. Restrict or include policies between repositories with the `-i` and `-e` option. The `-t` and `-f` repositories must be of the same type../ranger_policy_migration.py -u http://my_ranger.server.org:6080 -n admin -p admin -f hdp_hdfs -t cm_hdfs -i 207
  4. The `-e` option is the Policy Id in the *from* repository. Only non-matching policies are considered. ./ranger_policy_migration.py -u http://my_ranger.server.org:6080 -n admin -p admin -f hdp_hdfs -t cm_hdfs -e 210
    You can use these two options together.
Run process

Gather the matching *from* and *to* repositories for each service type and run this tool for each set. It can include, but not limited to: HDFS, Hive, YARN, HBase, Kafka, KNOX, Solr, and Atlas.