# Save data so that it is not deleted

**URL:** <https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548>\
**Category:** General\
**Created:** [18 January 2020 21:39 UTC](https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548 "2020-01-18T21:39:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReneS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/renes/32/82044_2.png) [@ReneS](https://discourse.nodered.org/u/ReneS)\
**Post date:** [18 January 2020 21:39 UTC](https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548/1 "2020-01-18T21:39:03Z")

</div>

Would like to save data, so if raspberry restarts or I update the flow, data in the now save in menory will not be lost. If data is just beginning but when the next data is gone:

 ![help](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/21e22760d206ff703b3bfa3413f656faff51eea5.png)

 ![help2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/8/8851ffe71a64f943347311bd209e90bc8ac542a1.png) ![help3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b1f2d81d6cf9677e0dcaeb4903858ca577829ee2.png)

Hope some can help me, Sincerely Rene

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [18 January 2020 21:52 UTC](https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548/3 "2020-01-18T21:52:23Z")

</div>

Most of the charts don't have built in data recovery options. If you need your display data to be always with near history presented, you will need to store all that data in some way and read it at the time you will need it and feed to the nodes in the way the can accept it. Quite of set up if there is many of such things to maintain.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [18 January 2020 22:03 UTC](https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548/4 "2020-01-18T22:03:48Z")

</div>

Could it be a node option to save it as `nodeContext`, similar to [node-red-contrib-simple-gate](https://github.com/drmibell/node-red-contrib-simple-gate/issues/3) so that it will persist a reboot.

![gate](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/4/84d3f6f1291439ae8ac813f8bce7805accb4106f.jpeg)

---

<div class="post-metadata">

**Author:** ![ReneS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/renes/32/82044_2.png) [@ReneS](https://discourse.nodered.org/u/ReneS)\
**Post date:** [18 January 2020 22:15 UTC](https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548/5 "2020-01-18T22:15:07Z")

</div>

> [@Paul-Reed](#):
>
> Could it be a node option to save it as `nodeContext` , similar to [node-red-contrib-simple-gate](https://github.com/drmibell/node-red-contrib-simple-gate/issues/3) so that it will persist a reboot.

how do i make a node Context, have it inside and see, and use it but I could make it work.`[{"id":"6585885f.e4ee28","type":"gate","z":"e58bb002.769c5","name":"","controlTopic":"test13","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":true,"x":550,"y":260,"wires":[[]]}]`

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [18 January 2020 22:22 UTC](https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548/6 "2020-01-18T22:22:50Z")

</div>

> [@ReneS](#):
>
> how do i make a node Context, have it inside and see, and use it but I could make it work.

It would be something that would need to be added to the `node-red-contrib-state-trail` node code by @hotNipi, _if he wished to add that feature_, and of course if it was possible.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [18 January 2020 22:33 UTC](https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548/7 "2020-01-18T22:33:56Z")

</div>

I think there will be much more than just me to turn nodes made by me to behave different from other similar nodes. I am tend to follow mainstream behaviors. Easy to understand and use. And as source is wide open, everybody can make versions to cover their needs.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [18 January 2020 22:41 UTC](https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548/8 "2020-01-18T22:41:06Z")

</div>

> [@hotNipi](#):
>
> Most of the charts don't have built in data recovery options

I think that the difference between this node and other chart nodes is that there is no output from the node, so the data cannot be saved to context, and re-injected after a reboot.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [18 January 2020 22:45 UTC](https://discourse.nodered.org/t/save-data-so-that-it-is-not-deleted/20548/9 "2020-01-18T22:45:00Z")

</div>

Data to be feeded to node can always be routed to different path. Long term storage should not be task for data visualization node.
