Make complete working copy of existing Node-RED install

Ok, as most of you are aware, I've got 110 tabs on my main Win10 PC standard install and I REALLY should sort this out! :slight_smile:

So, what I'm thinking is, make a copy of it (somehow) and then edit the main so it just has the flows I actually use 24/7 to keep the house #IoT working and then remove them from the copy

Suggestions as to how to proceed greatly welcome :slight_smile:

Simon, are you intending on running this on the same Win10 PC?

If so, you can simply copy .node-red to .node-red2 and run it up at the same time using a slightly modified cmd line to launch it (to adjust the working folder location and the port number) and I would start the duplicate in safe mode until you have disabled anything that might interfere

Any good? need more info on running up a 2nd instance?

1 Like

Surely it can't be that simple! Can it? :slight_smile:

Yep. See this for multiple instances

1 Like

Ok - off to read about starting in safe mode :slight_smile:

I'm sure you'll find it but for brevity...

  • node-red -p 1881 -u c:/nr1881 --safe

One word of warning - it will start running once you deploy - so be sure to disable anything that interferes (with the 1st instance) before deploy.


  1. How can I edit it to disable it before I enable it (chicken/egg)

  2. Isn't that the point of safe mode?

What i mean is - if you have any nodes that perhaps output to MQTT or to Database that you DONT want the 2nd instance to perform (as it could muck up the data first instance) you should change them or disable them so you dont have issues when you finally allow the 2nd instance to RUN.

Once both are running, the first instance may wellstill be doing all the work (initially) but you can begin to transfer logic between the two, you disable 1 part (in NR1) and enable (in NR2) that piece of logic (as quick as possible ;)). there are ways of minimising outage though (only you know your logic)

There is no real science to it - all i can really say is your approach (to minimise downtime) should be logical and staged.

To clarify, safe mode doesnt start your flow (node-red starts but flow doesnt execute) - so you are SAFE to run both instances. My point was when you DEPLOY changes to the 2nd instance - it WILL start running the flows (i.e. it drops out of safe mode)

Are you saying that I won't be able to disable some tabs in 2nd instance when I'm in safe mode?

#ConfusedOfEuxton :slight_smile:

Even more confused as your editing your post as I'm typing :slight_smile:

Got it now (after your last edit :slight_smile:

I'm not as thick as you think I am but it is good to proceed with that in the first place :slight_smile:

So - I am copying my .node-red folder

I will enable safe mode BEFORE starting my new instance

I will disable crictical tabs in new instance

I will restart new instance in normal mode

Right? :slight_smile:


you can do everything

Its just when you deploy - the runtime kicks in.

So be sure to disable anything that might interfere BEFRE deploy (as the runtime will kick in)

Pretty much spot on - though to clarify...

After your copy is done...

  • Fire up the new instance with --safe flag in the command line
  • disable crictical tabs in new instance
  • deploy so that modifications are saved (flow will start running after deploy)

Next time you start the 2nd instance, remove --safe

1 Like

PS, There is another way...

you can start another instance WITHOUT copying anything in just by creating an empty folder & starting node-red with the correct command line parameters.

This would fire up another instance but completely EMPTY - then you could migrate elements of your first flow piece by piece.

You can run even more instances for times when you are testing and trailing stuff.
Just remember to set a different path and port number.

This thread is clearer

1 Like

Just for clarification - if I'm launching from cd ing to the c:\users\simon\.node-red2 folder, do I need to specify c:/nr1881 in my command line?

And should not c:/nr1881 be the folder where the 2nd instance file are in? e.g c:\users\simon\.node-red2 in my case?

oh no.....

node-red -p 1881 -u c:/users/simon/.node-red2 --safe will do it.

the -u says - use this folder (and everything in side - i.e. your copy)

If you were to run node-red -p 1881 -u c:/nr1881 --safe it would try to use c:\nr1881 (it was just an example - i prefer to name the instance in a way that identifies what port they will be running as)

Ok - so I'm going to rename c:/users/simon/.node-red2 to c:/users/simon/.nr1881 and then use

node-red -p 1881 -u c:/users/simon/.nr1881 --safe

to launch it - yes?

Looks good Simon - fire away.

1 Like

wish me luck.... :slight_smile:

[edit] taking a while to get going- (well you would if you had 110 tabs in the flow :slight_smile:

[edit2]Looking good but been called back outside to do gardening work :frowning:


1 Like

Going thru disabling all conflicting type tabs/flows - thinking I maybe should have done a global search and replace in a text editor on the flows.json file instead :slight_smile:

[edit] OK - disabled all the 24/7 flows that I run on the main instance and deployed

Saw these two errors (which are to do with my contrib-alexa-remote2 nodes)


So I'm thinking that I'll remove that set of nodes as probably not designed to be running on the same machine in two separate instances

port conflict by the looks of it

but so far so good anyhow.

In future, when you want to do dev/test stuff - you now know you can spin up another instance

node-red -p 1882 -u c:/users/simon/.nr1882

Happy days.