Depending on what version of OH you are running, there is a backup and restore script in /usr/share/openhab2/bin (I think that is where it is). If you are running openHABian, there is a full system backup setup and configured for you as well (Amanda is what it is called I think) that you can run from openhabian-config.
You can look at that backup and restore script and see what gets backups and restored. I’m pretty sure that is is the entire contents of /etc/openhab2, /var/lib/openhab2/jsondb, and perhaps /var/lib/openhab2/persistence.
It is all in /var/lib/openhab2/jsondb. Note that this is a human readable file.