[mythtv-users] Backend DB migration--replace or just restore?

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Jul 27 09:35:59 UTC 2020


On Sun, 26 Jul 2020 14:59:41 -0400, you wrote:

>On Sun, Jul 26, 2020 at 2:54 PM DryHeat122 <dryheat122 at gmail.com> wrote:
>
>> Alright, thanks again for your patience answering dumb questions.  I have
>> installed the OS (18.04 since I had problems with 20.04) and mythtv. I have
>> not yet run mythtv-setup.  There is a config.xml in /home/mythtv/.mythtv
>> but not in /home/steve (in fact there is no .mythtv there either).  I am to
>> the point where I'm going to restore the mythconverg from my old machine
>> (which I have the idea I should do before running mythtv-setup).  The docs
>> say I should
>>
>> echo "DBBackupDirectory=/home/mythtv" > ~/.mythtv/backuprc
>>
>>
>> But if I do that the backuprc will wind up in /home/steve/.mythtv (which
>> like I said doesn't exist)  Shouldn't this go in /home/mythtv/.mythtv
>> instead?
>>
>>
>> What I do before restoring the database is to run mythtv-setup one time.
>That will create the mythtv user and put "steve" in the mythtv group. It
>will ask you to logout.  but I just reboot.  The you  can restore the
>database
>
>Jim A

I would second this.  You do need the "steve" user set up before doing
a database restore.  You need a config.xml file in all the right
places:

/etc/mythtv/config.xml
/home/mythtv/.mythtv/config.xml
/home/steve/.mythtv/config.xml

And you do need both the .mythtv subdirectories set up properly do be
able to have config.xml files in them.

The way it all works is using the "mythtv" group.  User "steve" has to
be a member of "mythtv" group.  The "mythtv" user must be a member of
"mythtv" group.  All the directories and files that MythTV needs
access to have to be accessible to the "mythtv" group - they have to
be members of the "mythtv" group and have the necessary permissions
for the "mythtv" group.  For a directory, that is normally read, write
and execute (rwx), as the x permission gives access to use a directory
(to change to that directory or list the files in or below that
directory).  For files other than directories, they need to have read
permission for "mythtv" group at least, and mostly also write
permission if the file needs to be changed or deleted.  Files only
need executable permission if they are executable files that need to
be run as part of MythTV (such as the tmdb Python files).

When you are setting up a new system, the packages installing MythTV
create the "mythtv" group and "mythtv" user.  However, they have no
way of knowing what user or users need to be part of the "mythtv"
group.  So when you run mythtv-setup or mythfrontend from a user, you
actually run a script that then runs mythtv-setup.real or
mythfrontend.real.  Part of what that script does is to check if the
user it is being run from has membership of "mythtv" group.  If it
does not, the script prompts you to allow it to add that user to the
"mythtv" group.  Unfortunately, due to how groups work, adding a user
to a group does not add any sessions that are already running as that
user to the group.  So in order for things to work, you have to stop
and restart all sessions that are running as the user (eg "steve")
that has just been added to "mythtv" group by the script.  The easiest
way to do that is to just reboot.  You can log out of the desktop and
log in again, but if you were running as user "steve" in a bare
terminal session on say Alt-F1, that session would still not have
picked up the membership of "mythtv" group.  And any ssh sessions
running as "steve" would have the same problem.  So a reboot is best.


More information about the mythtv-users mailing list