# Deleting flows.json e.g. exchange with another one

**URL:** <https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646>\
**Category:** General\
**Created:** [2 February 2022 13:35 UTC](https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646 "2022-02-02T13:35:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bannsaenger](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bannsaenger/32/55628_2.png) [@Bannsaenger](https://discourse.nodered.org/u/Bannsaenger)\
**Post date:** [2 February 2022 13:35 UTC](https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646/1 "2022-02-02T13:35:58Z")

</div>

Hi,  
I'm running node-red (Version 1.3.7) along with iobroker (Adapter Version 2.4.1).  
I try to exchange the flows.json with another file which was prepared on  
another system.  
After every restart of the node-red the old file is still present.  
Same issue when i delete the flows.json or empty it.  
Thanks for any suggestions.

---

<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:** [2 February 2022 14:05 UTC](https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646/2 "2022-02-02T14:05:44Z")

</div>

When you say that you restart node-red are you restarting it or re-booting?

Show us what the folder contents look like before you remove flows.json and what it looks like after removing that file and what it looks like after restarting node-red (not re-boot).

---

<div class="post-metadata">

**Author:** ![mschlgl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mschlgl/32/55640_2.png) [@mschlgl](https://discourse.nodered.org/u/mschlgl)\
**Post date:** [2 February 2022 15:44 UTC](https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646/3 "2022-02-02T15:44:42Z")

</div>

Hi, I'm working in the same issue, see the sequence of directory contents:  
Old flows.json file:  
 ![Screenshot 2022-02-02 163000](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0c443a3990b78df462974c42dc8562ff5c4af3d2.png)  
node red instance stopped and flows.json deleted:  
 ![Screenshot 2022-02-02 163052](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/8/c8b1ccba59ca7a39a72cfd2513c3da63c3530dfc.png)

Sorry have to put the rest in additional posts 😉

---

<div class="post-metadata">

**Author:** ![mschlgl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mschlgl/32/55640_2.png) [@mschlgl](https://discourse.nodered.org/u/mschlgl)\
**Post date:** [2 February 2022 15:45 UTC](https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646/4 "2022-02-02T15:45:52Z")

</div>

node red restarted:  
 ![Screenshot 2022-02-02 163140](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d2506fc447023f07f54714a0fd5a8ce9de4cf28a.png)  
node red instance stopped, flows.json replaced with new file:  
 ![Screenshot 2022-02-02 163301](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/7/b7a5bd15fc252d7c49647ae012e4f13e8709cae6.png)

---

<div class="post-metadata">

**Author:** ![mschlgl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mschlgl/32/55640_2.png) [@mschlgl](https://discourse.nodered.org/u/mschlgl)\
**Post date:** [2 February 2022 15:46 UTC](https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646/5 "2022-02-02T15:46:47Z")

</div>

node red instance started:  
 ![Screenshot 2022-02-02 163344](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/4/f4bad476e620bbe250237dcb06b9f062aed4c514.png)

We are wondering where the old flows.json content is coming from.  
Has nothing to do with "pretty" setting, the smaller flows.json file is missing flows which are present in the bigger one.

Any idea?

Sorry, I'm limited to max 3 replies so have to edit a previous one.

We're controlling Node-Red via ioBroker simply by starting/stopping the instance:

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

---

<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:** [2 February 2022 15:50 UTC](https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646/6 "2022-02-02T15:50:55Z")

</div>

There is nothing in Node-RED that would write to the flows file on startup. Something must be doing that outside of Node-RED.

How do you start/stop Node-RED?

---

<div class="post-metadata">

**Author:** ![Bannsaenger](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bannsaenger/32/55628_2.png) [@Bannsaenger](https://discourse.nodered.org/u/Bannsaenger)\
**Post date:** [15 February 2022 09:22 UTC](https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646/7 "2022-02-15T09:22:37Z")

</div>

The reason why the flows.json is replaced every time you start the iobroker instance is,  
that the content of the flows.json also resides in the iobroker database.  
So the solution is to stop the instance and delete the content of the  
array **"flows": [...]** in the iobroker database.  
Then you can exchange the flows.json and restart the instance.  
After the start the content of the flows.json will be copied in the iobroker database again.

 ![nodered-database-objects](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/1/1173aa292563d0d724fcab6fe04d77b553ecef66.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 March 2022 09:23 UTC](https://discourse.nodered.org/t/deleting-flows-json-e-g-exchange-with-another-one/57646/8 "2022-03-01T09:23:37Z")

</div>

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