How to restore a Lovelace dashboard?

For some reason one (and only one) of my lovelace dashboards is now empty and I’d like to restore it from a snapshot. I’m familiar with snapshots and have used them before, but I’m not sure if I can pick out something like a single dashboard for restoration.

Are lovelace dashboards contained in the ‘config’ section saved by a snapshot?
If I restore this (or wherever dashboards are saved) to another machine, is there a way to copy the old dashboard out and back?

I’d rather not restore the entire snapshot as I’d loose and have to repeat a fair amount of work, but if that’s the recommended way, that’s fine and I’ll do it.

All your config gets saved assuming you did a full snapshot.

You don’t have to restore the snapshot, you could just extract the .tar file on your computer. Inside that should be a homeassistant.tar.gz file where all your config is, extract that and then you can cherry pick the one file you need.

6 Likes

Thanks Sean - I’ve got that file and extracted it, but I cannot seem to see where the lovelace dashboards are. I have a blueprints folder, a TTS folder and so on. I’m familiar with files like configuration.yaml, but I cannot seem to see anything that holds the lovelace dashboards.

Do you have any thoughts on where they might be?

There should be a hidden .storage folder in the archive.

7 Likes

Perfect - thanks very much

I had this happen to me today. I’m religious with my snapshots and I have a full snapshot taken 16 hours ago… the only thing missing is a few Node-RED changes. I restored the entire snapshot and my dashboard is still missing. I then extracted only the Lovelace files as suggested above… and the dashboard is still missing. I’m aggravated because one of the dashboards had some incremental changes that I likely won’t be able to replicate… and, obviously, because I put a lot of effort into making sure I don’t lose stuff, and now I’ve lost stuff. Or, at least, it’s there and I can’t seem to restore it.

EDIT: I can open the missing Lovelace dashboard in Notepad++, but it’s not in YAML format so I can’t just dump it back into the raw configuration editor. If I could somehow convert it, I’d be back in business.

EDIT: I pulled out the JSON for each view in the snapshot, converted it here, and then added it manually to views in a new dashboard. Clunky, but it worked. Still no idea why the dashboard disappeared in the first place, however.

10 Likes

You are a saint. I accidentally deleted my main Dashboard and was able to restore it thanks to your EDITS.

1 Like

Thanks for inspiration! Since I crashed my UI dashboard for some reason, I copied the raw config what is a pain on a tablet. Found a nice online copy & paste converter (ideal foe mobile devices): Transform JSON into YAML - Online YAML Tools

3 Likes

I just did this but didn’t have to transform anything, just stopped HA, copied the file .storage/lovelace from backup (there could be more than one if you have more than one Dashboard) and restarted HA. Dashboard restored!

2 Likes

Life saver!! Thanks to everyone on this thread, the dashboard is back!

Thanks to this thread I was able to get my home dashboard back after deleting it.

Something got in a twist when I thought I’d try adding a dashboard that would load a URL (show a WLED screen for an LED string). I must have done it wrong and it sort of became a clone of Home, but I thought deleting it would just remove it and not touch Home… Wrong! It deleted Home and left WLED now showing what was in another dashboard.

I got the JSON for Home out of my last backup’s \config.storage\lovelace file and copied it into the live file. Also deleted the WLED dashboard! Restarted HA and it was all back to how it was before. Thanks all.

thanks for the converter!!! i lost my dashboard but still had it in a partial backup. thanks a million!

1 Like

Great!! Thanks a lot for your help! I restored my dashboard manually.

One more time, the steps:

  1. Open the TAR backup of yesterday
  2. I found the JSON dashboard in the backup homeassistant.tar into file data\.storage\lovealce (perhaps into another file, depending what you are looking for)
  3. Convert it using your tool https://www.json2yaml.com/no-ads-or-analytics
  4. Copy-paste the dashboard I need into my lovelace config using homeassistant’s editor of dashboard.
1 Like