Running a manual migration precheck for NiFi managed by Cloudera Manager

When preparing to migrate from Cloudera Flow Management 2.1.7 (NiFi 1–based) to Cloudera Flow Management 4.x (NiFi 2–based), you can run the migration precheck manually from the command line on your NiFi nodes, even if NiFi is managed by Cloudera Manager. The precheck helps identify potential issues before the transition to NiFi 2 by highlighting the required preparation steps and flagging breaking changes that cannot be automatically handled by the Cloudera Flow Management Migration Tool. The manual precheck provides greater administrative control and is useful in scenarios where a command-line–based process is required or preferred. Follow the below steps to perform a precheck directly from the command line.

This task must be performed in Cloudera Flow Management 2.1.7.
  1. Switch the user to NiFi using su nifi.
  2. Find the location of these files.
    1. pre_upgrade_check.py
    2. CFM4-Deprecated-components.csv
    3. NiFi-1.x-components-with-legacy-Kerberos-properties.csv
  3. Identify the ${NIFI_WORKING_DIRECTORY} environment variable, which can be found in stdout.log during NiFi startup.
  4. Use Python3 to run the script with the following command, replacing the placeholders with the actual paths.
    python3 [***/path/to***]/pre_upgrade_check.py \
    "${NIFI_WORKING_DIRECTORY}/flow.json.gz" \
    "[***/path/to***]/CFM4-Deprecated-components.csv" \
    "[***/path/to***]/NiFi-1.x-components-with-legacy-Kerberos-properties.csv" \
    "[***NIFI_WORKING_DIRECTORY***]/config_backup/bootstrap.conf" \
    "${CUSTOM_JAVA_HOME}"
    
  5. If necessary, specify the ${CUSTOM_JAVA_HOME} argument.
    This should be set if the JAVA_HOME environment variable for the "nifi" user is different from the JAVA_HOME you are using to run the NiFi service.
  6. Once all file paths are updated in the command, run it to start the migration precheck.