I have Raspberry Pi 3 with LibreELEC 7 installed. Wanted to upgrade Tvheadend 4.0 to 4.2 and keeping all my channel settings, autorec and recordings etc. This is how I did it:
1. Disable tvheadend 4.0 from add-ons
2. Install tvheadend 4.2 add-on
3. Disable tvheadend 4.2 add-on
4. Make SSH to libreelec and do these:
rm -rf /storage/.kodi/userdata/addon_data/service.tvheadend42
cp -a /storage/.kodi/userdata/addon_data/service.multimedia.tvheadend /storage/.kodi/userdata/addon_data/service.tvheadend42
rm /storage/.kodi/userdata/addon_data/service.tvheadend42/dvr/config/dvr-config
5. Create file: /storage/.kodi/userdata/addon_data/service.tvheadend42/dvr/config/8d0f5b7ae354d956d7fe5db25f5d0d24 with following contents (had to do this because tvheadend 4.2 did not recognize by existing PVR config and it falls back then do default config which has retention-days not set as "forever" which caused removal of my existing recordings):
{
"enabled": true,
"name": "",
"profile": "b58ead477958d8c79245e3f0f7e6d3af",
"cache": 2,
"retention-days": 2147483647,
"removal-days": 2147483647,
"clone": true,
"rerecord-errors": 0,
"warm-time": 30,
"pre-extra-time": 0,
"post-extra-time": 5,
"epg-update-window": 86400,
"epg-running": false,
"autorec-maxcount": 0,
"autorec-maxsched": 0,
"storage": "/var/media/recordings",
"storage-mfree": 1000,
"storage-mused": 0,
"file-permissions": "0664",
"charset": "UTF-8",
"tag-files": true,
"skip-commercials": false,
"pathname": "$t$-c%F$n.$x",
"directory-permissions": "0775",
"day-dir": false,
"channel-dir": false,
"title-dir": false,
"channel-in-title": true,
"date-in-title": true,
"time-in-title": false,
"episode-in-title": false,
"subtitle-in-title": false,
"omit-title": false,
"clean-title": true,
"whitespace-in-title": true,
"windows-compatible-filenames": false
}
Display More
6. Enable tvheadend 4.2 add-on
7. See file /storage/.kodi/userdata/addon_data/service.tvheadend42/service.log and you should see that Tvheadend should have successfully migrated the old configs to new ones.