2

I'm using GitFlowPersistenceProvider in NiFi Registry 0.3. Today I created another NiFi Registry and I wanted to load all flows from the previous one using the same provider. Unfortunately nothing happens - any buckets nor flows aren't recreated. I tried to create all buckets manually but even then any flows aren't imported.

GitFlowPersistenceProvider documentation states:

When NiFi Registry starts, this provider reads through Git commit histories and lookup these bucket.yml files to restore Buckets and Flows for each snapshot version.

What should I do to load existing flows into new NiFi Registry using GitFlowPersistenceProvider?

trivelt
  • 1,913
  • 3
  • 22
  • 44

2 Answers2

5

Unfortunately that documentation is not totally accurate. Currently there is a metadata DB which defaults to an embedded H2, but can also be Postgres, and then the flow storage. You would need to restore both in order to spin up a new instance with the same data.

In the next release there is a new feature where if you start a new instance with a completely empty DB (i.e. no buckets) and the git flow provider, then it will restore everything.

Bryan Bende
  • 18,320
  • 1
  • 28
  • 39
  • Thanks. Do you know if the next release will be supporting git repositories created by the current version of the NiFi Registry? – trivelt Apr 25 '19 at 06:23
  • Ah, and second question: if I'll be storing nifi-registry-primary.mv.db in the same git repository as the other flows, could be some problems during loading buckets and flows from the git? – trivelt Apr 25 '19 at 07:04
  • 1
    I'm not sure I follow the first question, do you mean will NiFi Registy 0.4.0 (next version) work with git repositories that were used for NiFi Registry 0.3.0? – Bryan Bende Apr 25 '19 at 13:04
  • 1
    I have never personally stored the H2 DB in git so I'm not sure of any issues there, but I don't see why it wouldn't work. You wouldn't need to load buckets and flows from git in that case since you have the DB already. – Bryan Bende Apr 25 '19 at 13:05
  • Regarding my first question - yes, this is exactly what I mean. – trivelt Apr 25 '19 at 17:09
  • 1
    Ok yes there should not be any breaking changes between 0.x releases, so you should be able to take the next release (0.4.0) and point it to the same DB and Git repo. – Bryan Bende Apr 25 '19 at 17:40
  • Is that still true with nifi 1.12.0? There is an option to import a versioned flow from the registry, but we got an error during importing. It still seems that the metadata of nifi is not recreated. Could someone ack that? – thilko Sep 23 '20 at 14:04
1

You can do the same by stopping nifi-registry 0.4.0 , deleting the database file ( if any) and then starting the nifi registry to rebuild the database based on git repo.

https://issues.apache.org/jira/browse/NIFIREG-209

SunilS
  • 2,030
  • 5
  • 34
  • 62