[mythtv] Upgrade database from command line

Michael T. Dean mtdean at thirdcontact.com
Sun Sep 7 10:55:57 UTC 2014

On 09/07/2014 02:19 AM, Joseph Fry wrote:
> On Sat, Sep 6, 2014 at 1:27 AM, Thomas Mashos wrote:
>> It seems unnecessary to make the user download a few GB just to upgrade
>> the DB.
> Agreed... the schema update code should be completely independent of the
> mythtv code in my mind.  A separate command line utility that could be
> kicked off by the package manager upon mythtv upgrade would be awesome.
>   Mythtv could still call it when it starts if it detects an outdated
> schema... but having it as separate code would be handy for some, and more
> elegant in my mind.  Especially if it were complete, such that it could
> upgrade from 0.19 to current and anything in between (just specify the
> schema version).

Of course the big problem is that the MythTV libraries--which contain 
all the database access code (and MythContext code) that's used by the 
code that upgrades the database is huge compared to the applications.  
So we'd either have to still ship out a large MythTV library set along 
with a tiny separate command-line utility or make it so that the upgrade 
application is (or at least could be) statically linked or make the 
utility with its own library of context and database access 
functionality (which would mean code duplication), possibly in some 
non-Qt/C++ language (but still redundant even if done in another 
language, including scripting languages, and likely to become out of 
date or broken (just like the MythWeb codebase) since we have a hard 
enough time keeping one codebase up to date).

FWIW, I don't think it's too much to ask users to install the version of 
MythTV they need to upgrade their databases--especially since the 
"remove ability to upgrade from ancient versions of MythTV" is something 
we seldom do.  We have only ever done so when some particular database 
upgrades are so ancient that they tend to fail with modern 
Qt/Qt-MySQL/MySQL--at which point users who are using those ancient 
versions should probably upgrade to the stable version (that's 
supported) as soon as they hear the development (next) version removes 
support for upgrading from their version if they care to keep their data.


More information about the mythtv-dev mailing list