[mythtv-users] database recovery, no backup

Michael T. Dean mtdean at thirdcontact.com
Thu Aug 16 16:34:02 UTC 2012


On 08/09/2012 07:16 PM, Ross Boylan wrote:
> 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).
> 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.


 From your other thread ( 
http://www.gossamer-threads.com/lists/mythtv/users/525478#525478 ), the 
reason you don't have an automatically-created database backup is:

2012-05-13 21:31:48.041371 C [342/342] CoreContext dbutil.cpp:217 
(BackupDB) - Database backups disabled. Skipping backup.

i.e. you explicitly disabled them with the mythtv-setup setting:

Disable automatic database backup
If enabled, MythTV will not backup the database before upgrades. You 
should therefore have your own database backup strategy in place.

IMHO, you should really consider re-enabling the automatic, 
for-your-own-protection database backups so even if you don't manually 
create a backup, you have options when things go wrong.

I'll try to get a chance, soon, to look into the DB upgrade process for 
users without MythVideo schema, but last I tested, it worked fine.  I'm 
thinking if there was a problem, it was external to MythTV (i.e. 
something killed and restarted mythbackend during the upgrade because it 
wasn't responding or whatever...), but I will run a test, again, of a 
0.24-0.25 upgrade of a DB schema without MythVideo schema.

Mike


More information about the mythtv-users mailing list