How to backup automations, scripts, etc?

Just realized that none of the automations, scripts, helpers etc are backed up when setting the auto-backup… Is it possible to back these other things up? If so, how do you set it so it’s done automatically on a certain interval?

(New to HA, so any “best practices” and “lessons learned” info are welcome!)

They should be if you are doing a full backup. Why do you think they are not?

https://www.home-assistant.io/common-tasks/general/#backups

All your automations, scripts, helpers etc… are in the config folder. If you are using the UI editors some of these may be in config/.storage which is hidden, but it is backed up.

Because when I set it up, it doesn’t list whether automations, scripts, & helpers were included in the backup. There isn’t an option to select it.

And when I tried to restore from backup, restoring them weren’t listed as an option. No option to recover it. When I go to the automations etc screens, they were completely blank – confirming none of it was recovered.

I’m having to recreate everything from scratch now, but at least since I’m new – there wasn’t a ton to recreate just yet. (15-20 automations & a handful of scripts and helpers.) Just wondered what else isn’t covered in backup and how people are making sure to get those things backed up.

I’ll see if I can access that folder and figure out where everything went. I’m still learning the ropes, so any hacks/tips on security, backup, and setup are greatly appreciated. :slight_smile:

Guess I’ve got my next lesson to learn… How do I locate/view hidden folders such as config/.storage ? Is there a setting I’m missing under Studio Code Server or File Editor, so that I can view those?

For file editor, go to the addon>configuration and click the X next to .storage

That will allow .storage to be viewed in the editor.

I removed the “Enforce basepath” option and made sure .storage was included & restarted the addon. It’s set to show folders first and it looks like they’re listed in alphabetical order.

I don’t see the folder in my view. Am I missing something? I’ve got HAOS on a laptop.

Its in the homeassistan/t folder. Go up one level

or the same folder your configuration.yaml folder resides.

Hmmm… Let me restart the addon again…?

Still no luck. I looked at the file editor logs and saw this:
INFO: Service exited with code 256 (by signal 15)

Any idea what the error means…?

Do you run Node-Red?

How are you running HA? I saw on a laptop so I assume a VM.

Nope, no Node Red. I was on a HA Green 2wks ago until I was able to install HAOS on laptop, so I’ve migrated to that now. My initial recovery was off HA Green into HAOS – but as I said, none of the automations etc showed up. Is that the problem?

Are you able to share the File Editor AddOn config? Remove any ssh keys

dirsfirst: true
enforce_basepath: false
git: true
ignore_pattern:
  - __pycache__
  - .cloud
  - deps
ssh_keys: []

Considering you changed device types, I’d suggest uninstalling Studio Code Server and File Editor and reinstall only File Editor for the time being.

1 Like

File editor shows ssh on line 9.

I’ll remove both addons and reinstall, then see what it looks like. BRB

Did you hit save after adjusting the config for the addon?

image

This line should be deleted

- .storage

1 Like

I uninstalled studio, no issues. I tried to remove the ssh and .storage lines in File editor yaml, but it gives me an error and won’t let me save.

I tried to uninstall the addon & toggled on the “permanently delete all data” to ensure I get a fresh reinstall. But unfortunately, it still has the ssh and .storage lines; I still get the error.

Add ssh_keys: []back to the config

It finally removed the .storage line at least, but the ssh won’t go away.

When I try to remove the ssh line, it gives me the error and won’t let me save the changes.

So yes, the ssh is back on.

You do not want the ssh line gone.

You want your config file to look like to start

dirsfirst: true
enforce_basepath: false
git: true
ignore_pattern:
  - __pycache__
  - .cloud
  - deps
ssh_keys: []

Now that .storage is gone, check if .storage appeared in the Directory after a restart.

They are included here:

The backup / restore function is not that granular.

Your option to restore them is here:

1 Like

To expand on the solid advice from @tom_l, you can restore those backup settings as a standalone option.