Beginner question

Hello - I am new to this, and trying to write some YAML code to get costings on an appliance. I am, of course, making lots of mistakes. I write something in the configuration.yaml, and save it, and restart it it and I can see the entities or whatever I have written appear.
My question is this. I am making mistakes, so when I go back to configuration.yaml, and delete it, and replace it, has the stuff I’ve deleted gone forever? And further, what happens with the configuration.yaml? Will that become a very long file as I write more yaml? Or, when I have it right, can I save it somewhere else?

Yes. If you don’t want to delete something permanently, you can comment out the parts you don’t want using a # at the start of each line.

Yes, if that’s what you want. A lot of integrations are configured in the frontend these days, so the YAML configuration doesn’t get as big as it used to.

Yes, you can split your configuration into multiple files various ways.

1 Like

You should be doing regular backups as you build your system. If you can use add-ons, Samba Backup is excellent for this - backups can be scheduled and can automatically copied elsewhere (to a NAS for example).

In addition, it’s not a bad idea to take copies of the yaml files in your config folder from time to time - they’re just text files. If you do this, it means you can reinstate individual files - your automations, say - without doing a restore of the whole system.

Again there is an excellent add-on for this. Samba Share makes it possible to access HA files from other machines on the network.

Add-ons are only available if you have a Home Assistant Operating System or Home Assistant Supervised installation.

1 Like

I can’t add much to the two excellent answers, above.

I can only reiterate that saving YAML files in some sort of working directory, off the HA machine, is very helpful. Every time I make a major YAML change, I save a copy of the old file, renamed to include the created date. I also save links to all the threads and sites I’ve found helpful, ideas for things I’d like to try, possible issues from the release notes, etc. Basically, I’ve built my your own reference library for HA.

I regularly sync the HA “config” share to another machine. This serves as a working copy of my active system, and of course as a handy backup in case I screw something up on the live system.

Thank you everyone for your help