Tvheadend stores all of its configuration data in /var/lib/tvheadend/ (new versions) or /home/hts/.hts/tvheadend (older versions, or systems which have been upgraded from older versions). You can back up that directory tree and restore it if you hit problems.