Forums » Tutorial and setups »
Auto migration 4.0 - 4.2
Added by Graham H over 7 years ago
I'm trying to write a script to migrate OSMC users from 4.0.9 to 4.2.2. We need [basic, advanced, htsp] in streaming and [basic, htsp, failed] in the dvr sections of the user file, but these are not being migrated by tvh.
If I create a user file with all these settings, tvh seems to wipe them as soon as it starts up for the first time after the upgrade.
Is there a trick?
Replies (10)
RE: Auto migration 4.0 - 4.2 - Added by Mark Clarkstone over 7 years ago
Graham H wrote:
I'm trying to write a script to migrate OSMC users from 4.0.9 to 4.2.2. We need [basic, advanced, htsp] in streaming and [basic, htsp, failed] in the dvr sections of the user file, but these are not being migrated by tvh.
If I create a user file with all these settings, tvh seems to wipe them as soon as it starts up for the first time after the upgrade.
Is there a trick?
There was a fix for this I believe - Are you using 4.2.2-75?
Actually, I think it needs to be backported to 4.2. I think the commit that fixes it is this one
RE: Auto migration 4.0 - 4.2 - Added by Graham H over 7 years ago
Don't know exactly - it just says 4.2.2.
That fix seems to deal only with failed. I'm losing all the settings, when tvh starts up.
Thanks for the quick response.
RE: Auto migration 4.0 - 4.2 - Added by Jaroslav Kysela over 7 years ago
Could you show the CFGDIR/accesscontrol/HASH file contents before and after migration ? I did a quick test here and it looks correct.
RE: Auto migration 4.0 - 4.2 - Added by Graham H over 7 years ago
Jaroslav Kysela wrote:
Could you show the CFGDIR/accesscontrol/HASH file contents before and after migration ?
before:
{ "enabled": 1, "username": "osmc", "comment": "Default access entry", "prefix": "0.0.0.0/0,::/0", "streaming": 1, "dvr": 1, "dvrallcfg": 1, "webui": 1, "admin": 1, "index": 1, "adv_streaming": 1, "password2": "VFZIZWFkZW5kLUhpZGUtb3NtYw==" }
after running the webui once:
{ "enabled": 1, "username": "osmc", "comment": "Default access entry", "prefix": "0.0.0.0/0,::/0", "dvrallcfg": 1, "webui": 1, "admin": 1, "index": 1, "streaming": [ "basic", "advanced" ], "dvr": [ "basic" ] }
As a minimum, we need the htsp setting to come through. In the 4.0.9 webui it is checked, but there doesn't seem to be a corresponding setting in the user's HASH file. Then we want dvr: failed because of the bug I reported and wizard: true (in both the user file and the password file to stop the default user getting wiped if the wizard is run. Should I just be able to add these options to the 4.0.9 file before upgrading? If so, with what syntax?
RE: Auto migration 4.0 - 4.2 - Added by Graham H over 7 years ago
OK, I think I have a working solution, but would like to sure of the changes to the configuration files made for each upgrade between v17 and v24. Are these documented?
Thanks for looking into this.
RE: Auto migration 4.0 - 4.2 - Added by Jaroslav Kysela over 7 years ago
This is a json ACL entry from tvh 4.0:
{ "index": 1, "enabled": true, "username": "*", "password2": "VFZIZWFkZW5kLUhpZGUtKg==", "prefix": "0.0.0.0/0,::/0", "streaming": true, "adv_streaming": true, "htsp_streaming": true, "profile": "", "dvr": true, "htsp_dvr": true, "all_dvr": true, "all_rw_dvr": true, "dvr_config": "", "webui": true, "admin": true, "conn_limit": 0, "channel_min": 0, "channel_max": 0, "channel_tag": "", "comment": "Default access entry1" }
And it's migrated to:
{ "index": 1, "enabled": true, "username": "*", "prefix": "0.0.0.0/0,::/0", "webui": true, "admin": true, "conn_limit": 0, "channel_min": 0, "channel_max": 0, "comment": "Default access entry", "profile": [ "" ], "dvr_config": [ "" ], "channel_tag": [ "" ], "streaming": [ "basic", "advanced", "htsp" ], "dvr": [ "failed", "basic", "htsp", "all", "all_rw" ] }
I don't see an issue.
The wizard - it's really a question if it should be run or not in case of migration from older version of tvh. Users can quickly cancel it when it's not required.
RE: Auto migration 4.0 - 4.2 - Added by Mark Clarkstone over 7 years ago
Jaroslav Kysela wrote:
This is a json ACL entry from tvh 4.0:
[...]
And it's migrated to:
[...]
I don't see an issue.
The wizard - it's really a question if it should be run or not in case of migration from older version of tvh. Users can quickly cancel it when it's not required.
Maybe the wizard could detect when a migration was performed & offer the user the option to run through the wizard if wanted?
RE: Auto migration 4.0 - 4.2 - Added by Graham H over 7 years ago
Jaroslav Kysela wrote:
This is a json ACL entry from tvh 4.0:
[...]
And it's migrated to:
[...]
I don't see an issue.
The wizard - it's really a question if it should be run or not in case of migration from older version of tvh. Users can quickly cancel it when it's not required.
Thanks for the templates. For some reason, installing tvh 4.0.9 on osmc resulted in a user config file which does not have the htsp settings and yet it works. I'll just make sure those are added in before the upgrade.
RE: Auto migration 4.0 - 4.2 - Added by Graham H over 7 years ago
Mark Clarkstone wrote:
Jaroslav Kysela wrote:
The wizard - it's really a question if it should be run or not in case of migration from older version of tvh. Users can quickly cancel it when it's not required.
Maybe the wizard could detect when a migration was performed & offer the user the option to run through the wizard if wanted?
I don't think it needs that level of sophistication. What would be good is for users to be able to run the wizard just for re-scanning channels without re-setting their user settings. I have just written "wizard": true in each of the default user and password files. That at least preserves the username and password if someone runs the wizard. Not sure if it preserves other user settings (profiles) but it should. The wizard doesn't run automatically unless the "wizard" flag is set in config. Is that right?
The wizard is brilliant, BTW! No need for all those how-tos any more.
RE: Auto migration 4.0 - 4.2 - Added by Mark Clarkstone over 7 years ago
Graham H wrote:
Mark Clarkstone wrote:
Jaroslav Kysela wrote:
The wizard - it's really a question if it should be run or not in case of migration from older version of tvh. Users can quickly cancel it when it's not required.
Maybe the wizard could detect when a migration was performed & offer the user the option to run through the wizard if wanted?
I don't think it needs that level of sophistication. What would be good is for users to be able to run the wizard just for re-scanning channels without re-setting their user settings.
Yes, this does sound like a better idea!
I have just written "wizard": true in each of the default user and password files. That at least preserves the username and password if someone runs the wizard. Not sure if it preserves other user settings (profiles) but it should. The wizard doesn't run automatically unless the "wizard" flag is set in config. Is that right?
The wizard is brilliant, BTW! No need for all those how-tos any more.
Yes, it does improve the overall experience a lot. It's a shame that the scanning portion is hindered by out of date tuning data. This could be solved in a number of ways.
- Add the option to import tuning data from various online sources based on country -> area "zip/post" code from the wizard. As an alternative offer a channel.conf/ini/xml upload/text box?
- For dvb-t/t2 do a "blind" scan limited by bandwidth. If a NIT is detected, scan those too. DVB-S would have to be done the way it is now. But I suppose for certain countries, a few well-known frequencies could be used as a seed for NIT.
Graham, If you'd like to help out with the docs feel free :p