Oh no, I forgot or lost my NiFi sensitive.props.key, what can I do?
- OPTION 2: NiFi provides a toolkit that allows you to change the nifi.sensitive.props.key and re-encrypt the sensitive properties in the flow.xml.gz at the same time.
- Advantages:
- No need to re-enter all your passwords in the flow.xml.gz
- Disadvantages/challenges:
- Need access to the following configuration files from original NiFi that goes with the flow.xml.gz
- nifi.properties
- bootstrap.conf
- flow.xml.gz
- Need access to the following configuration files from original NiFi that goes with the flow.xml.gz
- Process:
- Use the NiFi-toolkit "encrypt-config.sh" script. Cloudera includes the nifi-toolkit on each host where NiFi is deployed; the toolkit can also be downloaded from the Apache NiFi site.
- Collect copies of the nifi.properties, bootstrap.conf, and flow.xml.gz files from original source working NiFi.
- Execute the following toolkit:
./encrypt-config.sh -v -n /<path to copy of>/nifi.properties -o /tmp/nifi.properties.new -b /<path to copy of>/bootstrap.conf -f /<path to copy of>/flow.xml.gz -g /tmp/flow.xml.gz -s <newpassword> -x - After the above command is executed, you will have two new files written out to /tmp:
- A new nifi.properties file with the new password (encoded or plaintext depending on bootstrap.conf configuration) set.
- new flow.xml.gz with all "enc{...}" re-encoded to using the new nifi.sensitive.props.key provided in the above command.
- Use the nifi.senstive.props.* property values (4 of them) from the new nifi.properties file and the flow.xml.gz in your target NiFi.
- Advantages:
Thank you,
Matt

