[mythtv-users] database recovery, no backup

Ross Boylan RossBoylan at stanfordalumni.org
Thu Aug 9 23:16:12 UTC 2012


On Sat, 2012-07-21 at 10:12 -0400, Michael T. Dean wrote:
> On 07/20/2012 11:46 AM, Ross Boylan wrote:
> > During an upgrade from .24 to .25 (using Marillat's Debian repository)
> > my database got borked and the system won't start.  The standard advice
> > is to restore from backup, but I don't have one.
> >
> > I have all the recordings, and I assume that data is likely still in the
> > database.  I tried a little debugging, but haven't located the schema
> > migration code.
> >
> > Any advice about the best way to proceed?
> 
> Before MythTV upgrades the database, it will try its best to create a 
> database backup (unless you explicitly tell it not to with a setting).  
> It will place the backup in one of the directories in your DB Backups 
> Storage Group.  If you haven't specified a directory list for DB 
> Backups, it will place the backup in one of the directories in your 
> Default Storage Group.  If it can't find any of the directories it 
> should use, it will place the backup in your /tmp directory.
> 
> Look carefully through your MythTV Storage Group directories for a 
> backup:  ls /path/to/directory/*.sql*
> 
> Assuming you find it, do a full restore, then attempt a DB upgrade using 
> mythtv-setup. If it fails, please provide the log output from that 
> mythtv-setup run (i.e. start the program using:  mythtv-setup --logpath 
> /path/to/some/directory and it will create a log file in the specified 
> director).
> 
> Mike
Thank you for the pointers.  Unfortunately, there don't seem to be any
such files in my chroot (there are a couple of /tmp/*.sql*, but they are
from the original install of 0.24.2). I used 'find' for all filesystems
mounted in the chroot to be sure.

One reason for my cavalier upgrade procedure was that I thought backups
were being made for me... 

If my analysis, just posted in the "old mythvideo.DBSchemaVer" thread is
correct, it may not matter much.  That analysis suggests that some of
the relevant tables have been in a bad state basically since I started.
Since I haven't used mythvideo, it didn't become apparent until I
upgraded.  If that's true, restoring the database to its state just
before the upgrade wouldn't help anyway.

I'm considering resetting some schema numbers to the old 0.24.2 values,
since I don't think the upgrade touched very much (it just went from
1264 to 1266 for the main DB), and then forcing in the old 0.24.2
packages, including mythvideo, to see if that can put things in a sane
state.

Ross

Ross



More information about the mythtv-users mailing list