pre-alpha: Season Pass / Wishlist / Logo state backup & restore tool

Discussion in 'TiVo Underground' started by angra, Jan 29, 2003.

  1. Jan 29, 2003 #1 of 251
    angra

    angra Old Fogey

    183
    4
    Apr 12, 2002
    The volume of people mentioning a need of such a thing has motivated me to get off my duff enough to package the tool I had made. This tools is intended for making backups, from running tivos, of important state information. The tool backs up and restores:

    season passes
    wishlists
    logo assignments

    This software is AS-IS with no warranty. It will probably make your tivo turn into a doorstop. Please don't run this (especially the restore!) if you are not prepared for your tivo drive to be rendered useless. This means backups, being prepared to make new backups and restore from backup, etc.

    That said, I'm interested in hearing feedback from anyone who runs this. I don't have time to maintain this, so I can't promise timely fixes. I will not be offended at all if other people decide to take this code and "fork" it, so to speak, if I don't respond to requests quickly enough to suit.

    to use, unpack and read the README.

    you can PM me here or mail me at danspam@envy.gtf.org.

    good luck and enjoy.

    (edited 1/29/03 to clarify description)

    Note below that AGW has posted a modified version with important corrections.

    (eidted 2/24/03 to point to AGW bugfixed release)
     

    Attached Files:

  2. Jan 29, 2003 #2 of 251
    zaknafein

    zaknafein Shorthanded

    12,154
    0
    Jul 17, 2001
    Kansas City, MO
    Hey, nice. I assume this is geared for online backup?
     
  3. Jan 29, 2003 #3 of 251
    angra

    angra Old Fogey

    183
    4
    Apr 12, 2002
    Yes, sorry I was not explicit about this.

    This script is intended for an operating Tivo.
     
  4. Jan 29, 2003 #4 of 251
    mrtickle

    mrtickle Active Member

    2,824
    0
    Aug 26, 2001
    Birmingham, UK
    Thanks!

    The readme says that if you do a backup and restore without deleting wishlists/sps, you end up with two of everything. But what about logos, should you delete them too or will the restore overwrite existing ones? I see it's easy enough to comment out the "restore_logos" line so I'll probably do that.

    Oh one other thing, which software version did you use it with? Hopefully 2.5 and above, we have 2.5.5 here.

    TIA
     
  5. Jan 29, 2003 #5 of 251
    angra

    angra Old Fogey

    183
    4
    Apr 12, 2002
    Well I'm currently on 3.0.

    I _think_ I did some of this with 2.5, but I don't remember for sure. I am reasonably sure that nothing major changed in the SP/wishlist structure between those versions though.

    The logo stuff won't duplicate - it sets values in records that already exist, whereas the SP/WL stuff creates new records.
     
  6. Feb 4, 2003 #6 of 251
    SteakMan

    SteakMan New Member

    789
    0
    Nov 26, 2001
    Chicago
    Has anyone tried it on a DTiVo?

    I'll make a backup tonight, but I don't know when I'll have time to try a restore.

    So, since this essentially re-creates entries instead of restoring, it might be adapted to adjust your SP lineup offline :)

    -SteakMan-
     
  7. Feb 4, 2003 #7 of 251
    angra

    angra Old Fogey

    183
    4
    Apr 12, 2002
    yes, that could definitely work.

    if you feel adventurous, the backup file is pretty easy to read and you could probably tweak it.

    It doesnt completely automate the process though - you'd still have to delete your SPs on the tivo first. You could modify the restore script to delete existing SPs first though if you were so inclined.
     
  8. Feb 4, 2003 #8 of 251
    mrtickle

    mrtickle Active Member

    2,824
    0
    Aug 26, 2001
    Birmingham, UK
    Righto - thanks!
     
  9. Feb 21, 2003 #9 of 251
    agw

    agw New Member

    101
    0
    Feb 28, 2002
    I've just tried this script on my UK TiVo running 2.5.5 and unfortunately, while it picked up the wishlists and logos no problem, it didn't pick up the season passes.

    This is the entire restore_seasonpasses proc that it writes:

    proc restore_seasonpasses {} {
    global new_tms
    global new_tms_fs
    global newids
    global oldids
    #
    # SEASON PASSES
    #
    set new_tms ""
    set new_tms_fs ""
    }

    I've had a little play with the script and changing the line that does the ForeachMfsFile for the season passes to use the directory "/SeasonPass" instead of "/SeasonPass/User" appears to do the trick and fill in the season passes.

    This directory name corresponds with the directory name for the season passes in TiVoWeb.

    I've just bought a couple of 120Gb drives so I'll let you know if the script loads the season passes back on after the upgrade :) It'll be SO cool if it does. The thought of putting those back in by hand gives me the shivers... especially having to redo the priorities. It's a shame TiVoWeb doesn't give you an interface for setting the priorities because it's a nightmare doing it on the TiVo... too sloooooooooooooooow...
     
  10. Feb 21, 2003 #10 of 251
    agw

    agw New Member

    101
    0
    Feb 28, 2002
    Just to clarify before everyone points out that MFSTools will carry season passes over... this TiVo has already been upgraded once and MFSTools refuses to produce anything smaller than a 160 hour backup for it (I've used the -s option, no difference - ditto the -v(? can't remember) option that looks at stream sizes and not file sizes).

    So I've taken a backup of a friends 40 hour 2.5.5 (I have my original discs but they're ancient) and I'll be restoring THAT onto the 120 Gb discs and expanding it.

    Hence the reason why a season pass backup and restore script will be so useful.
     
  11. Feb 21, 2003 #11 of 251
    angra

    angra Old Fogey

    183
    4
    Apr 12, 2002
    sounds great! I'm glad you were able to find and correct the problem.

    I'll try to put together a modified version that reacts properly to UK tivos.
     
  12. Feb 21, 2003 #12 of 251
    jodell

    jodell TiVo geek

    138
    2
    Jul 9, 2002
    Irvine, CA
    angra,

    Any chance exporting "thumbs" could be added? I just added tivo #2 to my household and I want to move the new tivo to the living room. I will never get it done if i have to manually restore all the SP, wishlists and thumbs.

    Thanks,
    Jeff
     
  13. Feb 21, 2003 #13 of 251
    angra

    angra Old Fogey

    183
    4
    Apr 12, 2002
    hi, I tried to do thumbs, and I could reliably restore the thumbs themselves but it never seemed to impact the suggestions engine.

    The code is in the utilities as posted, just commented out, but as I said it doesn't quite work. Shows, actors, etc, will all be thumbed appropriately, but the prediction engine won't use this info properly.
     
  14. Feb 23, 2003 #14 of 251
    mrtickle

    mrtickle Active Member

    2,824
    0
    Aug 26, 2001
    Birmingham, UK
    Interesting, thanks for that. I think the /User structure was from software 3.0 onwards, which we don't have of course.

    Putting mine back by hand I wouldn't mind at all. What would annoy me is losing all my Hibernating Season Passes, I have loads of these which are not currently airing and which CANNOT be recreated, unless you use angra's wonderful script! I definitely do NOT want to use wishlists for these! The last time I thought it would be a "good idea" to use wishlists (big mistake) it took me a full year to get the SPs back.
     
  15. Feb 23, 2003 #15 of 251
    LJ

    LJ New Member

    786
    0
    Nov 11, 2001
    West...
    How long did you wait after importing to check for new suggestions? Looking in some of the test scripts in \tvlib\tcl\tv it looks like TiVo will take at least a few minutes to respond to a change in thumbs.

    Also I wonder if there's an event that needs to be sent to make TiVo see a change in thumbs if the change is made from a script rather than using the UI? For example ui.itcl sends a 'data changed' event when a season pass is updated - maybe a change in thumbs has it's own 'data changed' event?
     
  16. Feb 23, 2003 #16 of 251
    angra

    angra Old Fogey

    183
    4
    Apr 12, 2002
    I waited several hours - I think the last test I ran I waited about 12. It was long enough to populate the suggestions list, but it was filling it up with stuff on the restored system that bared no resemblance to the original one.

    you may be (probably are) right about the special event that needs to be sent.

    i went from having time to work on this stuff to not, about 4-6 months ago. I had some good tivoweb mods 3/4 finished too :/. Anyway I just dont have time to continue working on it seriously, especially since testing the thumbs engine stuff is very disruptive to my tivoing.
     
  17. Feb 23, 2003 #17 of 251
    StanSimmons

    StanSimmons Senior Moment Member

    4,717
    0
    Jun 10, 2000
    Flower...
    The same is true for US DTiVo's still running v2.5.
     
  18. Feb 23, 2003 #18 of 251
    agw

    agw New Member

    101
    0
    Feb 28, 2002
    Well, I ran the restore script and unfortunately it failed. The first part of restore restores the logos, which calls the file generated by backup, which in turn calls set_station_logo, which takes the tmsid it gets passed and tries to translate this to an fsid with station_tms_to_fsid.

    This function returns -1 if the tmsid it gets passed isn't in the MFS directory "/StationTms". The backup and restore were both done with the same cable package, so I'd have expected them to both have the same sets of stations - but regardless, sometimes this function was getting to the error return of -1. I didn't look too hard to see why as it wasn't really the problem.

    The problem is that set_station_logo doesn't test the value it gets back from station_tms_to_fsid, and so it falls over when it gets the "unknown" return. Ideally it should just puts stderr and skip that station.

    I changed my version of backup-support to do this and then the next problem I hit was that backup had generated a call to set_station_logo with only one parameter. In fact, it generated a few lines like this:

    set_station_logo 31611

    as opposed to the more usual:

    set_station_logo 21599 65539

    This stops the script because set_station_logo is expecting two parameters.

    I had a look and for me, TMS 31611 is "Living (Reduced)". It has no LogoIndex value associated with it, which is presumably why it's missing from the backup script output.

    The backup script needs to test the logo index to see if it's empty and if it is, don't write the line out.

    I've not had a look at the season passes and wishlist restores yet but I'll look soon. It looks like most of the errors are just missing checks for error conditions. If you went through and put those in everywhere then you'll probably cover most of the problems that would break the scripts.

    I've attached (I hope!) the changes I made to backup-settings and backup - these just set the season pass directory based on the version number (nicked from TivoWeb), skip stations with no LogoIndex when generating the output from backup and skip missing stations when restoring the backup. I'm a TCL newbie, I usually write C++, so please feel free to fix anything rubbish. I've marked the changes with # agw comments. There really aren't a lot of them.
     

    Attached Files:

  19. Feb 24, 2003 #19 of 251
    angra

    angra Old Fogey

    183
    4
    Apr 12, 2002
    I'm glad people are finding and correcting problems, and posting fixes. I've made a reference to your modified release in the top post so people will hopefully grab that.
     
  20. Feb 25, 2003 #20 of 251
    mrtickle

    mrtickle Active Member

    2,824
    0
    Aug 26, 2001
    Birmingham, UK
    Yep! Many thanks for this bit too:

    if {$version3} {
    set seasonpassdir "/SeasonPass/User"
    } else {
    set seasonpassdir "/SeasonPass"
    }

    :D
     

Share This Page