Migrating the metadata database

Provides steps for migrating the H2, PostgreSQL, or MySQL metadata database.

H2 database (default)

  1. Confirm the location of the source Registry metadata database specified by the nifi.registry.db.url property in nifi-registry.properties.
  2. Copy the database from the source NiFi Registry to the location specified by the NiFi Registry JDBC Url (nifi.registry.db.url) in the destination NiFi Registry configuration. The default directory path in CFM 2.1.5 is /var/lib/nifiregistry/database.

PostgreSQL

  1. In the destination Registry, match the configuration in the source nifi-registry.properties. Sample properties:
    • NiFi Registry JDBC Url (nifi.registry.db.url) – jdbc:postgresql://<POSTGRES-HOSTNAME>/nifireg

    • NiFi Registry JDBC Driver (nifi.registry.db.driver.class) – org.postgresql.Driver

    • NiFi Registry H2 directory storage location (nifi.registry.db.driver.directory) – /path/to/drivers

    • Username for NiFi Registry metadata database (nifi.registry.db.username) – nifireg

    • Password for NiFi Registry metadata database (nifi.registry.db.password) – changeme

  2. Save the changes.
  3. Download the Postgres JDBC driver and place it in the expected driver directory:
    /path/to/drivers/postgresql-driver.jar

MySQL

  1. In the destination Registry, match the configuration in the source nifi-registry.properties. Sample properties:
    • NiFi Registry JDBC Url (nifi.registry.db.url) – jdbc:mysql://<MYSQL-HOSTNAME>/nifi_registry

    • NiFi Registry JDBC Driver (nifi.registry.db.driver.class) – com.mysql.cj.jdbc.Driver

    • NiFi Registry H2 directory storage location (nifi.registry.db.driver.directory) – /path/to/drivers

    • Username for NiFi Registry metadata database (nifi.registry.db.username) – nifireg

    • Password for NiFi Registry metadata database (nifi.registry.db.password) – changeme

  2. Save the changes.
  3. Download the MySQL JDBC driver and place it in the expected driver directory:
    /path/to/drivers/mysql-connector-java-driver.jar

After you finish

When you have completed your metadata database migration, you may proceed by migrating your flow storage.