Import / Export node-red flow with same Id

Hello every one,

We have two node-red environment Development and production, both are host on IBM cloud. Now, when we export and re-import flow, node id get change so we are not able to find different between two env. Is there any ways to achieve same? I am thinking that if node id is same in export and after import, we can find the difference.

Also, Can you please suggest me how can we do version control with node-red? My node-red is host on IBM cloud and I am using Azure devops as repo.

I suggest you keep the flows in something like a git repository, then you can push an update from one system and pull it to the other, then the flows will be identical and you will also get version control.

The built in projects feature may also be useful for you so have a look at that.

Thanks for your reply

My node-red hosted on IBM cloud and as per the documentation Project is not supported if node-red hosted on IBM cloud

Our client is use Azure devops, so we must use same source control as other. so we cannot use git repo.

Is there any way to node id not changed when we re-import i.e. same as exported node id?

Well use whatever source control is available to control the relevant files. Then use that system to replicate the files across the systems.

In case you didn't realise, what you need to do to get an identical system is, usually, to copy all the files from your .node-red folder, except the node_modules and context folders and anything beginning with dot to the new system. Then if you have added or updated any nodes run npm install in the .node-red folder and then restart node-red. Make sure you have installed the same same versions of node-red and any globally installed nodes obviously. If you are using a version control system then those are the files you need to control. In addition you will need to think about how your credentials are stored. In particular how you handle the credentialsSecret setting. If you have that in settings.js then it will exist in plain text in your archive which may not be desirable, so you might need to think about how you manage the secret.

I agree with your point but my problem is different
My both environment on IBM cloud, so flows are stored into cloundent db. So I have only option delete existing flow and import the flow. When I import the flow node id get change so it is very difficult to find different between imported version and original or previous version.

Is that really the only option? I find it difficult to believe that there is no way of exporting the original files. Perhaps a new thread asking how to obtain the original source files on such a system would be worthwhile. If there is no way of doing that then I suggest using a different system, but maybe that is not an option for you.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.