# Today I discovered data will not survive to restart :(

**URL:** https://discourse.nodered.org/t/today-i-discovered-data-will-not-survive-to-restart/84085
**Category:** Dashboard
**Tags:** influxdb
**Created:** [28 December 2023 13:53 UTC](https://discourse.nodered.org/t/today-i-discovered-data-will-not-survive-to-restart/84085 "2023-12-28T13:53:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![realtebo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realtebo/32/85732_2.png) [@realtebo](https://discourse.nodered.org/u/realtebo)
#### Post date: [28 December 2023 13:53 UTC](https://discourse.nodered.org/t/today-i-discovered-data-will-not-survive-to-restart/84085/1 "2023-12-28T13:53:54Z")

</div>

It's only 2 weeks I play with RPI and node-red.  
I built 2 usefull, for me, workflows; both send data to dashboard. For me, historic data (last 2-3 days) is someway important.

Today, only today, I discovered than restarting node-red service wiped out all data from dashboard

My fault, of course. For some reasons, I expected than dashboard could handle persistance of data automatically.

So ... is it true? Dashboard is not saving and restoring data automatically? Just to be sure ...

If yes, is influxdb + grafana the best practice (i must run on RPi2 model b for now) ?

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [28 December 2023 14:24 UTC](https://discourse.nodered.org/t/today-i-discovered-data-will-not-survive-to-restart/84085/2 "2023-12-28T14:24:01Z")

</div>

Hi @realtebo

I don't use dashboard all that much, and whilst I stand to be corrected - I think that is true, DB does not persist data on it's own, so you need to develop a mechanism to do so.

example: store values in some database / file so you can then use it to restore the state of the graphs when Node RED / flows restarts using an `inject` to trigger after 1s to read the stored values and send them into the dashboard restoring its state

Here is one example by @dceejay  
[https://flows.nodered.org/flow/92920b4fd450bf92a3035e061947daa0](https://flows.nodered.org/flow/92920b4fd450bf92a3035e061947daa0)

You could also use the `global` or `flow` context stores, as long as Node RED is set to use the file system  
[https://nodered.org/docs/user-guide/context](https://nodered.org/docs/user-guide/context)

---

<div class="post-metadata">

### Author: ![stefan24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stefan24/32/23075_2.png) [@stefan24](https://discourse.nodered.org/u/stefan24)
#### Post date: [30 December 2023 12:52 UTC](https://discourse.nodered.org/t/today-i-discovered-data-will-not-survive-to-restart/84085/3 "2023-12-30T12:52:57Z")

</div>

Another solution, which I use for charts:

```auto
node-red-contrib-persist

```

A node-red node to persist data between Node Red deploys and restarts.  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f1377cc225c00333d4754ca7bf307582d55e3dbe.png)

EDIT: You need to trigger the "Persist Out" node with a inject node.

---

<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: [13 January 2024 12:53 UTC](https://discourse.nodered.org/t/today-i-discovered-data-will-not-survive-to-restart/84085/4 "2024-01-13T12:53:34Z")

</div>

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