Dashboard backup


is it possible to save dashboard data (for example chart data) for restart node-red service? At the moment i lost all Data.
At the Moment i use node-red-dashboard

Thank you


hmm what does the info box for the chart node say ?

"The node output contains an array of the chart state that can be persisted if needed. This can be passed into the chart node to re-display the persisted data."

But i dont know how i can do this.

Full Text:

Plots the input values on a chart. This can either be a time based line chart, a bar chart (vertical or horizontal), or a pie chart.

Each input msg.payload value will be converted to a number. If the conversion fails, the message is ignored.

Minimum and Maximum Y axis values are optional. The graph will auto-scale to any values received.

Multiple series can be shown on the same chart by using a different msg.topic value on each input message. Multiple bars of the same series can be shown by using the msg.label property.

The X axis defines a time window or a maximum number of points to display. Older data will be automatically removed from the graph. The axis labels can be formatted using a Moment.js time formatted string.

Inputting a msg.payload containing a blank array [] will clear the chart.

See this information for how to pre-format data to be passed in as a complete chart.

The Blank label field can be used to display some text before any valid data is received.

The label can also be set by a message property by setting the field to the name of the property, for example {{msg.topic}} .

The node output contains an array of the chart state that can be persisted if needed. This can be passed into the chart node to re-display the persisted data.

First of all, you need to create a file based context store, see https://nodered.org/docs/user-guide/context which is a means to save your chart data to your SD/hard disk so the data will survive a reboot.

Once you've done that, add a change node on the output of your chart node, and set it to save the output to flow.context

And finally, add a inject node to the input of the same chart node, set to inject once on startup, and inject the flow.context back into the chart node, which will restore the chart to how it was before the reboot.


There is an example in the flows site that purports to do exactly what you want

1 Like

Ok i will test it today.
Thank you

Isn't that an old example - pre context data?

1 Like

Yes, but it still works. Probably the author should update it, I don't suppose he is very busy at the moment. :slight_smile:

1 Like

@corin.corvus give me 5 minutes and I'll do you an example flow...

Set up your file based context store first as per the link above, then see this flow -

1 Like

now i think i did it.
i have a context folder in .node-red with a file.

now i impored your flow. may i connect all charts with one change node or i have to add a change node for each chart?

ok i tested it with one chart. after restart the data was dropped.

i set this in settings.js:

contextStorage: {
    default: {

But i can see the data in "contextdata" in webgui but without data before restart.

You need to have a different store for each chart, otherwise all of your charts will display the same data.

Example -

Did you reboot after setting up the context store to make it available?
Can you try again.

is this ok?

data are in

can i "service nodered restart"?

That looks ok, however I can't see the inject node feeding into the chart node, I'll assume it's off-screen.
You need to inject the saved data back into the chart when it restarts (just like my example flow)

Can you stop/start again.


the test works fine!

do i need both for each chart ? do i need click on all before i restart or only one time forever?

Yes, a change node to save the chart data, and a inject node to restore the chart data.

You don't need to click the inject node at all. It will inject the data automatically after a reboot/restart because the 'Inject once...' box is ticked.


It will look after itself with no interaction necessary.

1 Like

Ah ok.

its done. Thank you :slight_smile:

1 Like

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