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

Bill Meek keemllib at gmail.com
Sun Jul 26 18:15:51 UTC 2020

On 7/26/20 1:02 PM, DryHeat122 wrote:
> On Sun, Jul 26, 2020 at 10:49 AM James Abernathy <jfabernathy at gmail.com <mailto:jfabernathy at gmail.com>> wrote:
>         [snip]
>          > Bill thanks for all the advice.  I'm really grateful.  I have started over just to get back to square one and undo anything I have
>         screwed up.
>          > I have two questions about xmltv I will post on the other thread.  Re installation:  Should I run everything--i.e. mythtv-setup, xmltv
>          > config--as user mythtv rather than as user steve?  I'm thinking the answer is yes and this is where I started developing problems before.
>         mythtv-setup is always to be run as user mythtv, but in reality, it probably isn't. In the past, that meant that
>         things like Storage Directories can't be read and the tests for them fail (if proper 'normal' permissions were
>         used.)
>         XMLTV adds a new reason for that. But I didn't use it, rather did the configuration from the command line.
>         And in that case also ran it as user mythtv.
>         Being practical, or perhaps lazy/forgetful, I added a line in my .bashrc so I can run mythfilldatabase
>         without thinking too hard:
>             alias mfdbrun='sudo --login --user=mythtv mythfilldatabase'
>         -- 
>         Bill
>     Here's my problem with trying to run mythtv-setup as user 'mythtv'.  I just confirmed this on a fresh Ubuntu 20.04 system.  When the Ubuntu
>     system was installed the initial user was 'jim'.  The mythtv install created the 'mythtv' user but it is not a normal login user so to run
>     mythtv-setup as 'mythtv' I had to give user 'mythtv' a password.  If I do that I have to logout and back in as user 'mythtv' and run
>     mythtv-setup otherwise I get some xhost error.
>     When you exit. mythtv-setup, it  asks to start the backend and if you say yes, it asks for a password which will not work with user 'mythtv'
>     unless you've added mythtv to the sudo group.
>     To avoid all these issues, while user jim, I just sudo su mythtv and create the recordings directory with mkdir /home/mythtv/recordings and
>     then it has the right permissions.  While I'm there I set up XMLTV since I'm user mythtv. Once that's done I exit back to user jim and run
>     mythtv-setup.
>     Never had a problem. However if I have to run mythfilldatabase manually, I sudo su mythtv and then run it.
>     JIm A
> OK so, just to make sure I understand the advice and I am getting consistent advice....do run xmltv config as mythtv, but run mythtv-setup as 
> steve, not mythtv.  Right?  And also I should make sure the permissions on my video storage directory permit mythtv as well.

I left out the detail that I switched my mythtv user to a full user. But the comment
on the new Wiki line reflects that.

To be specific, you're setting up XMLTV but will now use tv_grab_zz_sdjson_sqlite (if you're still
opting for the SQLite version.) And, yes run the commands as user mythtv.

Re "video storage" any directory that mythtv needs to access must have the proper read/write/search
permissions. For example:

$ ls -ld /var/lib/mythtv/videos
drwxrwsr-x 2 mythtv mythtv 4096 Apr 14  2015 /var/lib/mythtv/videos


More information about the mythtv-users mailing list