TVHeadend backup/restore channellist and tags / backup restore addons manually

Here´s my little howto. Partly first seen in a posting from kodinerds.

Assuming you have already a TVHeadend Installation and want to backup
your channellist for restoring it in a fresh new installation.

I have DVBS2 and Satip DVBS Tuner. May be with DVBT or DVBC some things are different.

Imhop most work with TVHeadend is to get a small channel list fitting your personal needs
and sorted for your interests and not the funny standard bouquets you will get without addional work.
Nobody needs more than 3000 activated muxes/services - the first channel you´re always watching on place 648 and the next one at 2710… And EPG search and tranfer to your device will take a long time.

So - Configure your hardware and basic settings. There are already a lot of howtos in the net for this.
Let a initial scan be done. Map only the services you need.
Add channel Tags e.g. HD, FreeTV, Sport, Kidz, News or wathever you want to get things sorted. Assign your activated channels to your channel tags.

This work only has to be done once.

Do not forget to activate " synchronise channelgroups with backend " in kodi pvr/tv settings

If everything is in place as you like:

Make SCREENSHOTS OF YOUR WORKING (BASIC) CONFIGURATION !

Stop TVheadend service in kodi

backup /storage/.kodi/userdata/addon_data/service.tvheadend42/input/dvb/networks/YOURNetwork-ID/muxes

backup
/storage/.kodi/userdata/addon_data/service.tvheadend42/channel

Activate Tvheadend

On the new device/fresh installation :

activate TVHeadend, do your basic Config (Quick done with the screenshots you made!)
let a initial scan de done
mux only 1 service

don´t forget your picons, recording path, deactivating not needed EPG modules
and if you have more than 1 tuner: 1 tuner for EPG is enough.

Is this one activated channel doing its job ? fine…

Then :

deactivate TVHeadend service

delete
/storage/.kodi/userdata/addon_data/service.tvheadend42/input/dvb/networks/YOURNetwork-ID/muxes

and delete
/storage/.kodi/userdata/addon_data/service.tvheadend42/channel

restore “muxes” from backup to
/storage/.kodi/userdata/addon_data/service.tvheadend42/input/dvb/networks/YOURNetwork-ID/

restore “channel” from backup to
/storage/.kodi/userdata/addon_data/service.tvheadend42/

activate TVHeadend and restart your device
then let TVheadend do another scan and EPG update

thats it. All yours channels and channelgroups are in place again.


Another thing I prefer with setting up a device with a fresh installation is that I do not wan´t to configure all addons again and again.
Takes me hours of work with api keys, language settings and so on.

Well - this is the way I do prefer:

make a backup directory on my nas

copied

.kodi/addons

.kodi/userdata/addon_data

.kodi/userdata/Thumbnails

.kodi/userdata/advancedsettings.xml …/passwords.xml …/favourites.xml …/sources.xml?

storage/cdm

storage/picons

(may differ in your installation if u have videos or music files on the SD Card)

Then I do a fresh installation on SD Card

configured the system

Copied all files back, restarted and enabled all addons. Restarted again.
not working addons normally only need to be updated from repo.
Done.

EDIT :

to be safe do a additionally internal backup before copying/deleting things manually
so you can restore if the result is trouble

if build Versions old/new are strongly different then do not copy old addons over new ones already there from a fresh installation. Copy only the addon_data in this case to get configurations back you have already made.

Using the internal kodi file manager I always add sources for this job beginning from root

1 Like

Just a little remark.

The downgrade from TVHeadend 4.4 to 4.2 is not possible from my understanding. I don’t know what changed but channels are not recognized. However, I wrote a little tool that uses the icon name to identify the channels and rewrite the channel tags. So it restores channel tags for all channels.

If anyone is interested I can provide the tool here.

It can also be used for fresh installs of TVHeadend of course.

1 Like

I use tvheadend 4.2 on all my devices because its running very stable. But good to know a tool for downgrading exists.

I would like to know your friend tool

Howto:

  1. Map Services (after muxes and channels are found) for the freshly installed TVHeadend.
  2. Execute the tool.
  3. Drop the source(tags to copy from) folder e.g. \service.tvheadend44 inside the console application.
  4. Drop the target(tags to restore to) folder e.g. \service.tvheadend42 inside the console application.
  5. Choose the tag to be restored, if more than one is needed, rerun the tool for each tag.

Info:

  1. If channels are not found in the target folder, you have to rerun the tool after TVHeadend found them and you mapped them successfully. The tool can only add tags to available channels.
  2. Also the tool restores tags based on the icon name, so icon name have to be the same for both TVHeadend installations. Initially, they are the same.
  3. I tested it only for DVB-S channels, DVB-T might work.

It is a windows x64 application. If there is demand, I will port it to OSX.

TVHTagRestore.zip (237.7 KB)

2 Likes