http://docs.openhab.org/installation/linux.html#backup-and-restore
Basically everything under /etc/openhab2 (if you are using a Linux apt setup). Check the subchapters of http://docs.openhab.org/configuration/index.html - I know that a good chunk of info is missing in this area but you’ll still learn a lot there.
You will also greatly benefit from Examples. Check: