Preserve / store configuration on nodes

Hi,

First - thanks for writing an awesome tool! NR has helped us immensely in multiple areas.

I want to be able to preserve / store / use parameters on nodes so that when they are deployed on a new instance of Node-RED a person does not need to edit a lot of nodes manually.

Example: mysql node, dashboard node.

I have a projects with multiple flows that includes the necessary mysql nodes with connection configuration parameters (Host; Port; User; Password; Database; Timezone). It also contains a complex dashboard. This is deployed onto a Node-RED test instance (in this example a Windows 10 machine). Once I'm finished writing / debugging I now want to deploy this project to a different production machine.

Currently I've been exporting / importing via the clipboard option. This works, in that you have a complete flow, but there are many, many manual tasks to complete afterwards. These tasks are sometimes incomplete and the process is fragile.

These tasks are:

  1. Install nodes you have added that are not in the base packages - e.g. mysql, dashboard - so install them
  2. Find every instance of the mysql node (I may have more than 30) and setup the specific parameters
  3. Find and configure all of the dashboard nodes - this is even more painful than the mysql nodes
  4. Save and redeploy
  5. Retest / loop through until satisfied

Is there a way to 'copy' an image of a complete Node-RED instance and move it to another machine in a portable manner? I've started looking into Docker but wonder if that is more than I need.

I will need multiple copies of Node-RED running on one machine, so that was what lead me to Docker...

I'm open to ideas!

Cheers,
Paul

You could of course copy the node-red folder. All flows and installed nodes will be inside.

But if you have specific settings per device, this will still be a problem.

Perhaps instead of fixed specific values littered throughout your nodes, you could use environmental variables or flow/global context (node capability permitting)? You could have a single flow tab that sets up all specific variables into flow / global context (only one place to setup) and make your functional parts common?

It is the "userDir" folder that you are interested in since this contains all of the configuration for a running instance of Node-RED.

You can easily copy it but note that it will generally contain a node_modules folder which it is best not to copy as it can be very large. To avoid that, copy without that folder then from a command line, switch to the copied folder and run npm install.