<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: NiFi Registry Flow Persistence Provider switch from File System to GIT - Unable to carry existing buckets to GIT ? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Registry-Flow-Persistence-Provider-switch-from-File/m-p/317554#M227224</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/37332"&gt;@hegdemahendra&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The NiFi CLI toolkit [1] can help here to an extent.&lt;/P&gt;&lt;P&gt;This toolkit provides the following NiFi-Registry capabilities:&lt;/P&gt;&lt;PRE&gt;registry current-user
registry list-buckets
registry create-bucket
registry delete-bucket
registry list-flows
registry create-flow
registry delete-flow
registry list-flow-versions
registry export-flow-version
registry import-flow-version
registry sync-flow-versions
registry transfer-flow-version
registry diff-flow-versions
registry upload-bundle
registry upload-bundles
registry list-bundle-groups
registry list-bundle-artifacts
registry list-bundle-versions
registry download-bundle
registry get-bundle-checksum
registry list-extension-tags
registry list-extensions
registry list-users
registry create-user
registry update-user
registry list-user-groups
registry create-user-group
registry update-user-group
registry get-policy
registry update-policy
registry update-bucket-policy&lt;/PRE&gt;&lt;P&gt;You can get a description of each by executing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;path to&amp;gt;/cli.sh registry sync-flow-versions -h&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you are changing FlowPersistence providers and not trying to sync flows to a new NiFi-Registry, You really can't use the above "&lt;STRONG&gt;sync-flow-versions&lt;/STRONG&gt;" function. Plus, I really don't see it even in that scenario being able to accomplish your goal because you would end up with new flow ids.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;When you create a bucket in NiFi-Registry it is assigned a bucket if (random uuid).&lt;BR /&gt;When you version control a Process Group (PG) in NiFi, you choose an existing bucket and it first creates a new flow id (Random UUID assigned to the flow).&amp;nbsp; Then the initial version 1 of that PG flow is created and assigned to that flow id in the NiFi-Registry.&amp;nbsp; Since you cannot force the flow id assigned UUID, syncing flows from registry 1 to registry 2, would not track to your version controlled PGs in your NiFI because of change in flow id.&lt;BR /&gt;&lt;BR /&gt;In your scenario, you would need to export all your flows (version by version and it is important you keep rack of the version fo the flow you extract).&amp;nbsp; So for a flow with ID &lt;STRONG&gt;&lt;EM&gt;XYZ&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;you may have 6 versions.&amp;nbsp; This means you would use:&lt;/P&gt;&lt;PRE&gt;registry export-flow-version&lt;/PRE&gt;&lt;P&gt;I'd suggest naming the produced json file using source flow id&amp;nbsp;and flow version like&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;XYZ_v1.json, XYZ_v2.json, &lt;/EM&gt;&lt;/STRONG&gt;etc...&lt;BR /&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;./cli.sh registry export-flow-version -ot json -u http://&amp;lt;nifi-registry hostname&amp;gt;:&amp;lt;port&amp;gt;/ -f c97fd570-e2ef-4001-98c9-8810244b6015 -fv 1 -o /tmp/c97fd570-e2ef-4001-98c9-8810244b6015_ver1.json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You should then save off your original DB.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Delete all existing flows so all you have are your original buckets&lt;BR /&gt;Then you would need to take all these exported flows and import them back in to registry after switching to your new persistence provider.&amp;nbsp; Now keep in mind before importing each flow version you must first create a new flow within the correct still existing buckets. Keep track of these newly assigned flow ids and which original flow id you are importing in to them (very important)&lt;BR /&gt;Then you MUST import each new flow in exact version 1 to version x order.&amp;nbsp; If you import version 5 of flow XYZ first it will become version 1 within that new flow Id.&amp;nbsp; &amp;nbsp;The version persisted in the output json is not used when importing, it is assigned the next incremental version in the new flow id.&lt;BR /&gt;Once you are done here you have a bunch of new flow ids with all your versions imported.&lt;BR /&gt;&lt;BR /&gt;Now you need to go edit your flow.xml.gz in NiFi.&lt;BR /&gt;For every version controlled PG in that flow.xml.gz you will find a section that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        &amp;lt;versionControlInformation&amp;gt;
          &amp;lt;registryId&amp;gt;912e8161-0176-1000-ffff-ffff98135aca&amp;lt;/registryId&amp;gt;
          &amp;lt;bucketId&amp;gt;0cab84ff-399b-4113-9767-687e8e33e48a&amp;lt;/bucketId&amp;gt;
          &amp;lt;bucketName&amp;gt;bucket-name&amp;lt;/bucketName&amp;gt;
          &amp;lt;flowId&amp;gt;136b3ba8-bc6f-46dd-afe5-235a80ef8cfe&amp;lt;/flowId&amp;gt;
          &amp;lt;flowName&amp;gt;flow-name&amp;lt;/flowName&amp;gt;
          &amp;lt;flowDescription/&amp;gt;
          &amp;lt;version&amp;gt;5&amp;lt;/version&amp;gt;
        &amp;lt;/versionControlInformation&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything here should remain the same except fro the change in "&lt;STRONG&gt;flowId&lt;/STRONG&gt;"&lt;BR /&gt;This would allow you to do a global search and replace on "&lt;STRONG&gt;&amp;lt;flowId&amp;gt;original id&amp;lt;/flowId&amp;gt;&lt;/STRONG&gt;" to "&lt;STRONG&gt;&amp;lt;flowId&amp;gt;new id&amp;lt;/flowId&amp;gt;&lt;/STRONG&gt;".&lt;BR /&gt;&lt;BR /&gt;Make sure you stop all NiFi nodes,&amp;nbsp; put same modified flow.xml.gz on all nodes (backup original), and start NiFi nodes again.&amp;nbsp; Your PGs should now be tracking to your new flows imported in your registry now backed by the gitFlowPersistenceProvider.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[1]&amp;nbsp;&lt;A href="https://nifi.apache.org/docs/nifi-docs/html/toolkit-guide.html#nifi_CLI" target="_blank" rel="noopener"&gt;https://nifi.apache.org/docs/nifi-docs/html/toolkit-guide.html#nifi_CLI&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry there is no automated path for this.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;If you found this addressed your query, please take a moment to login and click "Accept" on those solutions which assisted you.&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jun 2021 14:27:06 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2021-06-02T14:27:06Z</dc:date>
    <item>
      <title>NiFi Registry Flow Persistence Provider switch from File System to GIT - Unable to carry existing buckets to GIT ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Registry-Flow-Persistence-Provider-switch-from-File/m-p/317493#M227189</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have nifi registry with MySQL db as metadata store and FileSystem as Persistence provider.&lt;/P&gt;&lt;P&gt;And this registry has 10+ flows with multiple versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I am trying to integrate registry to GIT, that is trying to change persistence provider from FileSystem to GIT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I referred some docs (below urls) and steps to switch persistence provider etc, those all help for fresh GIT integration set and they wont carry/migrate already created buckets/flows/versions from FileSystem to GIT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-registry-docs/html/administration-guide.html#switching-from-other-flow-persistence-provider" target="_blank"&gt;https://nifi.apache.org/docs/nifi-registry-docs/html/administration-guide.html#switching-from-other-flow-persistence-provider&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/t5/Community-Articles/Storing-Apache-NiFi-Versioned-Flows-in-a-Git-Repository/ta-p/248713" target="_blank"&gt;https://community.cloudera.com/t5/Community-Articles/Storing-Apache-NiFi-Versioned-Flows-in-a-Git-Repository/ta-p/248713&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help on this would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mahendra&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 15:29:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Registry-Flow-Persistence-Provider-switch-from-File/m-p/317493#M227189</guid>
      <dc:creator>hegdemahendra</dc:creator>
      <dc:date>2021-06-01T15:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Registry Flow Persistence Provider switch from File System to GIT - Unable to carry existing buckets to GIT ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Registry-Flow-Persistence-Provider-switch-from-File/m-p/317501#M227195</link>
      <description>&lt;P&gt;it's only for new saves.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you probably need to export those with NiFi Cli and reimport after adding git and restart&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:12:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Registry-Flow-Persistence-Provider-switch-from-File/m-p/317501#M227195</guid>
      <dc:creator>TimothySpann</dc:creator>
      <dc:date>2021-06-01T17:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Registry Flow Persistence Provider switch from File System to GIT - Unable to carry existing buckets to GIT ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Registry-Flow-Persistence-Provider-switch-from-File/m-p/317554#M227224</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/37332"&gt;@hegdemahendra&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The NiFi CLI toolkit [1] can help here to an extent.&lt;/P&gt;&lt;P&gt;This toolkit provides the following NiFi-Registry capabilities:&lt;/P&gt;&lt;PRE&gt;registry current-user
registry list-buckets
registry create-bucket
registry delete-bucket
registry list-flows
registry create-flow
registry delete-flow
registry list-flow-versions
registry export-flow-version
registry import-flow-version
registry sync-flow-versions
registry transfer-flow-version
registry diff-flow-versions
registry upload-bundle
registry upload-bundles
registry list-bundle-groups
registry list-bundle-artifacts
registry list-bundle-versions
registry download-bundle
registry get-bundle-checksum
registry list-extension-tags
registry list-extensions
registry list-users
registry create-user
registry update-user
registry list-user-groups
registry create-user-group
registry update-user-group
registry get-policy
registry update-policy
registry update-bucket-policy&lt;/PRE&gt;&lt;P&gt;You can get a description of each by executing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;path to&amp;gt;/cli.sh registry sync-flow-versions -h&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you are changing FlowPersistence providers and not trying to sync flows to a new NiFi-Registry, You really can't use the above "&lt;STRONG&gt;sync-flow-versions&lt;/STRONG&gt;" function. Plus, I really don't see it even in that scenario being able to accomplish your goal because you would end up with new flow ids.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;When you create a bucket in NiFi-Registry it is assigned a bucket if (random uuid).&lt;BR /&gt;When you version control a Process Group (PG) in NiFi, you choose an existing bucket and it first creates a new flow id (Random UUID assigned to the flow).&amp;nbsp; Then the initial version 1 of that PG flow is created and assigned to that flow id in the NiFi-Registry.&amp;nbsp; Since you cannot force the flow id assigned UUID, syncing flows from registry 1 to registry 2, would not track to your version controlled PGs in your NiFI because of change in flow id.&lt;BR /&gt;&lt;BR /&gt;In your scenario, you would need to export all your flows (version by version and it is important you keep rack of the version fo the flow you extract).&amp;nbsp; So for a flow with ID &lt;STRONG&gt;&lt;EM&gt;XYZ&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;you may have 6 versions.&amp;nbsp; This means you would use:&lt;/P&gt;&lt;PRE&gt;registry export-flow-version&lt;/PRE&gt;&lt;P&gt;I'd suggest naming the produced json file using source flow id&amp;nbsp;and flow version like&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;XYZ_v1.json, XYZ_v2.json, &lt;/EM&gt;&lt;/STRONG&gt;etc...&lt;BR /&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;./cli.sh registry export-flow-version -ot json -u http://&amp;lt;nifi-registry hostname&amp;gt;:&amp;lt;port&amp;gt;/ -f c97fd570-e2ef-4001-98c9-8810244b6015 -fv 1 -o /tmp/c97fd570-e2ef-4001-98c9-8810244b6015_ver1.json&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You should then save off your original DB.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Delete all existing flows so all you have are your original buckets&lt;BR /&gt;Then you would need to take all these exported flows and import them back in to registry after switching to your new persistence provider.&amp;nbsp; Now keep in mind before importing each flow version you must first create a new flow within the correct still existing buckets. Keep track of these newly assigned flow ids and which original flow id you are importing in to them (very important)&lt;BR /&gt;Then you MUST import each new flow in exact version 1 to version x order.&amp;nbsp; If you import version 5 of flow XYZ first it will become version 1 within that new flow Id.&amp;nbsp; &amp;nbsp;The version persisted in the output json is not used when importing, it is assigned the next incremental version in the new flow id.&lt;BR /&gt;Once you are done here you have a bunch of new flow ids with all your versions imported.&lt;BR /&gt;&lt;BR /&gt;Now you need to go edit your flow.xml.gz in NiFi.&lt;BR /&gt;For every version controlled PG in that flow.xml.gz you will find a section that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        &amp;lt;versionControlInformation&amp;gt;
          &amp;lt;registryId&amp;gt;912e8161-0176-1000-ffff-ffff98135aca&amp;lt;/registryId&amp;gt;
          &amp;lt;bucketId&amp;gt;0cab84ff-399b-4113-9767-687e8e33e48a&amp;lt;/bucketId&amp;gt;
          &amp;lt;bucketName&amp;gt;bucket-name&amp;lt;/bucketName&amp;gt;
          &amp;lt;flowId&amp;gt;136b3ba8-bc6f-46dd-afe5-235a80ef8cfe&amp;lt;/flowId&amp;gt;
          &amp;lt;flowName&amp;gt;flow-name&amp;lt;/flowName&amp;gt;
          &amp;lt;flowDescription/&amp;gt;
          &amp;lt;version&amp;gt;5&amp;lt;/version&amp;gt;
        &amp;lt;/versionControlInformation&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything here should remain the same except fro the change in "&lt;STRONG&gt;flowId&lt;/STRONG&gt;"&lt;BR /&gt;This would allow you to do a global search and replace on "&lt;STRONG&gt;&amp;lt;flowId&amp;gt;original id&amp;lt;/flowId&amp;gt;&lt;/STRONG&gt;" to "&lt;STRONG&gt;&amp;lt;flowId&amp;gt;new id&amp;lt;/flowId&amp;gt;&lt;/STRONG&gt;".&lt;BR /&gt;&lt;BR /&gt;Make sure you stop all NiFi nodes,&amp;nbsp; put same modified flow.xml.gz on all nodes (backup original), and start NiFi nodes again.&amp;nbsp; Your PGs should now be tracking to your new flows imported in your registry now backed by the gitFlowPersistenceProvider.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[1]&amp;nbsp;&lt;A href="https://nifi.apache.org/docs/nifi-docs/html/toolkit-guide.html#nifi_CLI" target="_blank" rel="noopener"&gt;https://nifi.apache.org/docs/nifi-docs/html/toolkit-guide.html#nifi_CLI&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry there is no automated path for this.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;If you found this addressed your query, please take a moment to login and click "Accept" on those solutions which assisted you.&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 14:27:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Registry-Flow-Persistence-Provider-switch-from-File/m-p/317554#M227224</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2021-06-02T14:27:06Z</dc:date>
    </item>
  </channel>
</rss>

