# Does assigning a new IP cause all flows to be lost?

**URL:** <https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167>\
**Category:** General\
**Created:** [20 April 2020 03:47 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167 "2020-04-20T03:47:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![MoJeeza](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mojeeza/32/20225_2.png) [@MoJeeza](https://discourse.nodered.org/u/MoJeeza)\
**Post date:** [20 April 2020 03:47 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/1 "2020-04-20T03:47:40Z")

</div>

Since rebooting my laptop and router after a powerfail - I have lost all my flows and dashboard.

I searched this forum and google found nothing that points to loss due to new ip assignment.  
Found some info when server/machine name is changed.

I searched all .json files under the .node-red folder (windows 10) but nothing refers to the old ip address.  
laptop name remains the same.

Settings file is original - not changed at all.

I have now assigned/reserved a static ip address (different from before) which is outside the dhcp range.

Any suggestions on how I can recover my flows and the dashboard?  
Thanks

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 April 2020 06:19 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/2 "2020-04-20T06:19:54Z")

</div>

What files do you see in your .node-red folder? Show us a directory listing please. Include hidden files, if Windows normally hides those.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [20 April 2020 13:38 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/3 "2020-04-20T13:38:13Z")

</div>

hi @MoJeeza

by default, Node-RED includes the hostname in the name of the flow file it uses. If you change hostname (or IP, as you have done), then it'll be looking for a different file than the one you have.

This is why Colin asked to see what files you have.

If you look in the `~/.node-red` directory you should see a file call `flows_XYZ.json` and `flows_XYZ_cred.json` - where XYZ is the old hostname.

When NR starts up it logs the name of the flow file it is trying to use. The quick fix is to rename the flow file to match that - replacing the `XYZ` part of the name - be sure to rename the `_creds.json` file as well.

---

<div class="post-metadata">

**Author:** ![MoJeeza](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mojeeza/32/20225_2.png) [@MoJeeza](https://discourse.nodered.org/u/MoJeeza)\
**Post date:** [20 April 2020 16:12 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/4 "2020-04-20T16:12:33Z")

</div>

@Colin Thanks for your reply...my issue is resolved - don't know what I did to resolve it but one of the things I did was reboot again and make sure the Mac address I used to reserve my fixed IP was the Physical address of the wireless lan adapter Wi-Fi for the laptop not the virtual ones that VirtualBox adapter uses.  
So, I'm back in business.  
I made sure I saved first all contents of the ./node-red folder before I did anything...that was a lot of work I put into those flows and the dashboard. 😌

---

<div class="post-metadata">

**Author:** ![MoJeeza](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mojeeza/32/20225_2.png) [@MoJeeza](https://discourse.nodered.org/u/MoJeeza)\
**Post date:** [20 April 2020 16:15 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/5 "2020-04-20T16:15:41Z")

</div>

@knolleary Greatly appreciate you following up with details to reply from @Colin  
Thanks guys.

Now I regularly export to my own folder inside library as Json formatted file - for any changes I make.

I'm learning as I go along...

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 April 2020 16:32 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/6 "2020-04-20T16:32:37Z")

</div>

If you use the projects feature (or manually use git to archive your files if you prefer) then you can always recover the latest or earlier versions of the files. If you use github for your repository (they provide free repositories for free now) then even if your system goes up in smoke you will still be able to recover the files.

---

<div class="post-metadata">

**Author:** ![MoJeeza](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mojeeza/32/20225_2.png) [@MoJeeza](https://discourse.nodered.org/u/MoJeeza)\
**Post date:** [20 April 2020 16:38 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/7 "2020-04-20T16:38:04Z")

</div>

@Colin I am on Git, in-fact I login to node-red site using git credentials.  
That is an awesome feature you mention. I should look up how to do this. I'm just getting back into node-red after a very long break.  
Thanks.

---

<div class="post-metadata">

**Author:** ![MoJeeza](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mojeeza/32/20225_2.png) [@MoJeeza](https://discourse.nodered.org/u/MoJeeza)\
**Post date:** [20 April 2020 17:56 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/8 "2020-04-20T17:56:17Z")

</div>

So the answer to the Question: No, it does not....but better to have a static IP for the machine that runs the NR Server.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 April 2020 19:29 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/9 "2020-04-20T19:29:39Z")

</div>

Out of interest, what were the names of the old and new flow files? I knew the name would change with host name, but I didn't realise the ip address would change it.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [20 April 2020 19:50 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/10 "2020-04-20T19:50:19Z")

</div>

On some dhcp systems, the hostname gets generated as something like `dhcp-192-168-1-2` - ie, including the IP in the generated hostname.

I can't remember the exact circumstances it does that... been way too long since I've last had to deal with dhcpd and such.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 April 2020 20:07 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/11 "2020-04-20T20:07:18Z")

</div>

Ah, that would explain it, I have never seen that as far as I can recall

---

<div class="post-metadata">

**Author:** ![MoJeeza](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mojeeza/32/20225_2.png) [@MoJeeza](https://discourse.nodered.org/u/MoJeeza)\
**Post date:** [21 April 2020 03:38 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/12 "2020-04-21T03:38:23Z")

</div>

@Colin

Names of none of the files had changed. Only the IP had changed.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2365787abb4c139247f4b643dbc8852446ffe2f.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 April 2020 07:53 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/13 "2020-04-21T07:53:06Z")

</div>

> [@MoJeeza](#):
>
> Names of none of the files had changed. Only the IP had changed.

So it wasn't that node red was picking up a different flows file.  
When it was failing, what exactly was the symptom you were seeing? When you said you had lost all your flows I (and I think others) assumed that node-red was running normally but, in the editor, all the flows were empty.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [21 April 2020 08:02 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/14 "2020-04-21T08:02:18Z")

</div>

> [@Colin](#):
>
> So it wasn't that node red was picking up a different flows file.

I don't think we know that from the screenshot.

And given everything else @MoJeeza has said that points 100% at this being the issue, I don't see why there's a need to go looking for another explanation.

The only way to be sure would be to check the startup log of NR where it reports the exact flow file it is trying to use and to compare that with the files that are actually there.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 April 2020 08:19 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/15 "2020-04-21T08:19:22Z")

</div>

There isn't a flows file whose name includes an ip, so unless the hostname was changed and has now changed back again then I don't understand what happened. I always like to understand a problem. However it is obviously up to @MoJeeza whether he is concerned or not. I was wondering whether the symptom actually seen was an inability to access node-red at all rather than an apparently empty flows file.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 April 2020 10:21 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/16 "2020-04-21T10:21:48Z")

</div>

unless they actually created a new flow and deployed it (to save it) there would not be a new file.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 April 2020 12:36 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/17 "2020-04-21T12:36:28Z")

</div>

True, but if there system was including the ip address in the host name then I would have expected to see that in flows file name. Unless it only does that in certain circumstances.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 April 2020 12:46 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/18 "2020-04-21T12:46:01Z")

</div>

it may not be the ip address - it maybe the domain... eg my mac has been known to give me hostname DCJmac.lan and/or [DCJmac.uk.ibm.com](http://DCJmac.uk.ibm.com) don't sweat it. it can happen.

---

<div class="post-metadata">

**Author:** ![MoJeeza](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mojeeza/32/20225_2.png) [@MoJeeza](https://discourse.nodered.org/u/MoJeeza)\
**Post date:** [21 April 2020 16:25 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/19 "2020-04-21T16:25:18Z")

</div>

Gentlemen: Unfortunately, I did not know enough about node-red at the time, to have looked deeply into the cause and to look at the log.

To clarify - there was no change in the name of the laptop - just a new IP had been assigned.

So before the power fail, I was working on one flow and 4 others were disabled.  
When power was restored - I started the node-red server from command prompt by typing node-red.  
I did not pay attention at the messages - went to the url that I usually type: [http://192.168.0.26:1880](http://192.168.0.26:1880)  
and I saw a blank flow (empty editor).

So started googling for solutions...at the time, I did not realize a new IP had been assigned the the laptop.

All my google results indicated only change in name would cause this and that the filenames had the server name embedded in them. Knowing that I had not changed the name I thought of posting the Q on this forum about effect of IP change to loss of workflows.

So as a lesson learnt - I decided to assign a fixed IP address to my laptop - and there too I overlooked one issue - I used a virtual mac address (assigned by VirtualBox) and not the mac add from the physical adapter. Once that was sorted out, I had a working fixed address.

Also in the mean time, I had saved the contents of ".node-red" folder. By this time, I had opened one of the json files and found that my flows were indeed there.

After assigning a fixed address, I rebooted the laptop again and re-started the node-red and using the new IP address in the url, I was happily surprised to see my environment restored...

I also assigned in the hosts file: a name to the new fixed IP address - same name that I have assigned "W10SSD" that was embeddef in files under .node\_red folder (my laptop name)

Now let's look at the following trail...

C:\Users\mohsi.node-red\>node-red  
20 Apr 01:54:07 - [info]

# Welcome to Node-RED

20 Apr 01:54:07 - [info] Node-RED version: v1.0.5  
20 Apr 01:54:07 - [info] Node.js version: v10.15.3  
20 Apr 01:54:07 - [info] Windows\_NT 10.0.18363 x64 LE  
20 Apr 01:54:08 - [info] Loading palette nodes  
20 Apr 01:54:09 - [info] Dashboard version 2.14.0 started at /ui  
20 Apr 01:54:10 - [info] Settings file : \Users\mohsi.node-red\settings.js  
20 Apr 01:54:10 - [info] Context store : 'default' [module=memory]  
20 Apr 01:54:10 - [info] User directory : \Users\mohsi.node-red  
20 Apr 01:54:10 - [warn] Projects disabled : editorTheme.projects.enabled=false  
20 Apr 01:54:10 - [info] Flows file : \Users\mohsi.node-red\flows\_W10SSD.json  
20 Apr 01:54:10 - [warn]

* * *

Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials  
file will not be recoverable, you will have to delete it and re-enter  
your credentials.

## You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.

20 Apr 01:54:10 - [info] Starting flows  
20 Apr 01:54:10 - [info] Started flows  
20 Apr 01:54:10 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
20 Apr 01:54:10 - [info] serial port COM5 opened at 115200 baud 8N1  
20 Apr 02:12:29 - [info] Stopping flows  
20 Apr 02:12:29 - [info] serial port COM5 closed  
20 Apr 02:12:29 - [info] Stopped flows  
20 Apr 02:12:29 - [info] Starting flows  
20 Apr 02:12:29 - [info] Started flows  
20 Apr 02:12:29 - [info] serial port COM5 opened at 115200 baud 8N1  
20 Apr 02:15:09 - [info] Stopping flows  
20 Apr 02:15:09 - [info] serial port COM5 closed  
20 Apr 02:15:09 - [info] Stopped flows  
20 Apr 02:15:09 - [info] Starting flows  
20 Apr 02:15:09 - [info] Started flows  
20 Apr 02:15:09 - [info] serial port COM5 opened at 115200 baud 8N1  
20 Apr 02:15:38 - [info] Stopping flows  
20 Apr 02:15:38 - [info] serial port COM5 closed  
20 Apr 02:15:39 - [info] Stopped flows  
20 Apr 02:15:39 - [info] Starting flows  
20 Apr 02:15:39 - [info] Started flows  
20 Apr 02:15:39 - [info] serial port COM5 opened at 115200 baud 8N1  
20 Apr 02:16:47 - [info] Stopping flows  
20 Apr 02:16:47 - [info] serial port COM5 closed  
20 Apr 02:16:47 - [info] Stopped flows  
20 Apr 02:16:47 - [info] Starting flows  
20 Apr 02:16:47 - [info] Started flows  
20 Apr 02:16:47 - [info] serial port COM5 opened at 115200 baud 8N1  
20 Apr 02:31:38 - [info] Stopping flows  
20 Apr 02:31:38 - [info] serial port COM5 closed  
20 Apr 02:31:38 - [info] Stopped flows  
20 Apr 02:31:38 - [info] Starting flows  
20 Apr 02:31:38 - [info] Started flows  
20 Apr 02:31:38 - [info] serial port COM5 opened at 115200 baud 8N1  
20 Apr 02:36:14 - [info] Stopping flows  
20 Apr 02:36:14 - [info] serial port COM5 closed  
20 Apr 02:36:14 - [info] Stopped flows  
20 Apr 02:36:14 - [info] Starting flows  
20 Apr 02:36:14 - [info] Started flows  
20 Apr 02:36:14 - [info] serial port COM5 opened at 115200 baud 8N1  
21 Apr 11:33:12 - [info] Stopping flows  
21 Apr 11:33:12 - [info] serial port COM5 closed  
21 Apr 11:33:12 - [info] Stopped flows  
Terminate batch job (Y/N)? y

C:\Users\mohsi.node-red\>node-red  
21 Apr 11:33:44 - [info]

# Welcome to Node-RED

21 Apr 11:33:44 - [info] Node-RED version: v1.0.5  
21 Apr 11:33:44 - [info] Node.js version: v10.15.3  
21 Apr 11:33:44 - [info] Windows\_NT 10.0.18363 x64 LE  
21 Apr 11:33:45 - [info] Loading palette nodes  
21 Apr 11:33:47 - [info] Dashboard version 2.14.0 started at /ui  
21 Apr 11:33:48 - [info] Settings file : \Users\mohsi.node-red\settings.js  
21 Apr 11:33:48 - [info] Context store : 'default' [module=memory]  
21 Apr 11:33:48 - [info] User directory : \Users\mohsi.node-red  
21 Apr 11:33:48 - [warn] Projects disabled : editorTheme.projects.enabled=false  
21 Apr 11:33:48 - [info] Flows file : \Users\mohsi.node-red\flows\_W10SSD.json  
21 Apr 11:33:48 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
21 Apr 11:33:48 - [warn]

* * *

Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials  
file will not be recoverable, you will have to delete it and re-enter  
your credentials.

## You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.

21 Apr 11:33:48 - [info] Starting flows  
21 Apr 11:33:48 - [info] Started flows  
21 Apr 11:33:48 - [info] serial port COM5 opened at 115200 baud 8N1

At 11:33:12 - the server was not responding (so I thought)...because I was trying to connect using the normal IP address based url.

This morning, I can no longer access the editor or ui using the ip based url:  
192.168.0.42:1880

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/0/f03cf04999d4cd1904dbf5d4881add5f7f999523.png)

I have to use the name:  
w10ssd:1880 and w10ssd:1880/ui

Last night it worked perfectly:

 ![dht1_flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/59240b7da0eeb2510df834b3c94adf2d43a6ce92.png)

Nothing has changed since last night.

For me that is not an issue but just thought I'd add it to the discussion.

I also checked the entire windows registry - node-red does not store the ip address there (or at least I could not find it).

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 April 2020 17:34 UTC](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167/20 "2020-04-21T17:34:41Z")

</div>

> [@MoJeeza](#):
>
> w10ssd:1880

Are you sure the machine has the IP 192.168.0.42? What do you see if you run  
`ping w10ssd`

[Next page](https://discourse.nodered.org/t/does-assigning-a-new-ip-cause-all-flows-to-be-lost/25167.md?page=2)
