What is the best Backup approach for Everything?

After many reinstalls and testing I finally got my RPI-4 working with the latest OS, HG, Mono, Java, HA-Bridge, and Echobridge. I can finally ask Alexa to turn my light on and off! So my first thought was, do a backup and save this working version. HG does a backup, but I started to realize that it’s probably only HG, not all the other pieces I installed. First can someone confirm what exactly gets backed up in the HG backup?
Next, other than saving a bunch of micro SD cards as backups, is there a good way to save everything to one big file that could be saved on another computer like Windows? What is everyone else doing for backups?

Your most reliable backup is to take an image of your SD card. You’ll have one single file which will contain everything your SC card does and can be easily imaged onto another SD card when needed.

Of course the image file will be exactly the same size as your SD card so if you use a 16gb card your image file will be 16gb.

This very useful utility will allow you to reduce that image down to about 1gb. Read through it and see how it works

Creating an image will definitely work and is a very good approach. The only down side is that you have to store it somewhere and then reimage at the time of a failure. I personally opt for rpi-clone which creates a bit-for-bit backup of the files onto a new card. That new card is ready to go and if you have a failure you can simply swap it in. It is designed to use a USB-to-sd adapter but there are other configurations that have been added.

Basically:

  1. install rpi-clone
  2. insert sd/microsd in usb adapter into port
  3. locate correct mounting location
  4. run backup command

You can then either leave the usb adapter in place and run a crontab periodically to update only changed files or pull the card and swap upon failure. I do both as I have a backup that sits in a case next to the RPi and one in the usb adapter staying better up to date.