Migrating NiFi data directories

This section provides a step-by-step process to migrate the NiFi data directories.

When you are migrating any of the following from the source cluster to the destination cluster, ensure that the file and directory ownerships and permissions are consistent.

The database_repository consists of two H2 databases and their corresponding lock files:

  • nifi-flow-audit.h2.db
  • nifi-flow-audit.lock.db
  • nifi-user-keys.h2.db
  • nifi-user-keys.lock.db

The nifi-user-keys.h2.db contains information about who has logged into NiFi, if NiFi has been secured. The nifi-flow-audit.h2.db contains flow configuration history. These databases only need to be migrated if this historical information needs to be retained, but note that any NiFi nodes referenced in them will refer to the source nodes. If you do not wish to retain the database information, you may skip step 2.

  1. Copy the entire provenance_repository directory from a source cluster node to a node on the destination cluster. Provenance repositories cannot be merged. For example: source Node 1 → destination Node 1, source Node 2 → destination Node 2, … source Node N → destination Node N.
  2. Copy the entire database_repository directory from a source cluster node to a node on the destination cluster. For example: source Node 1 → destination Node 1, source Node 2 → destination Node 2, … source Node N → destination Node N.

When you have completed the provenance_repository and database_repository migration, migrate the NiFi flow.xml.gz file.