Mailing List Archive

Backend DB migration--replace or just restore?
I am replacing my Ubuntu 16.04 setup with a clean install of Myth on a
clean install of Utuntu 20.04. I have the old mythconverg backed up and am
getting ready to restore. The wiki backend migration page
<https://www.mythtv.org/wiki/Backend_migration> says "Depending on how your
distribution initialises the database upon installation of the backend, you
may need to use the procedure for replacing the database by the backup
<https://www.mythtv.org/wiki/Database_Backup_and_Restore#Replacing_an_existing_database>
."

The referenced page says: " If you are replacing an existing database with
a known-good backup by using a full restore--for example, because your
database has been corrupted or a database schema upgrade failed or you're
replacing a package-provided database with your "old" database after
re-installing your distro--you will need to drop the existing database. "

I don't know how 20.04 initializes the DB. I am not replacing the DB
because of corruption or failed upgrade. Do I run mythconverg_restore.pl
with defaults or include the drop and create arguments? Also to be clear,
I should restore the DB after installing myth but before running setup,
right?
Re: Backend DB migration--replace or just restore? [ In reply to ]
On 7/25/20 11:09 AM, DryHeat122 wrote:
> I am replacing my Ubuntu 16.04 setup with a clean install of Myth on a
> clean install of Utuntu 20.04.  I have the old mythconverg backed up
> and am getting ready to restore.  The wiki backend migration page
> <https://www.mythtv.org/wiki/Backend_migration> says "Depending on how
> your distribution initialises the database upon installation of the
> backend, you may need to use the procedure for replacing the database
> by the backup
> <https://www.mythtv.org/wiki/Database_Backup_and_Restore#Replacing_an_existing_database>."
>
>
> The referenced page says: " If you are replacing an existing database
> with a known-good backup by using a full restore--for example, because
> your database has been corrupted or a database schema upgrade failed
> or you're replacing a package-provided database with your "old"
> database after re-installing your distro--you will need to drop the
> existing database. "
>
> I don't know how 20.04 initializes the DB.  I am not replacing the DB
> because of corruption or failed upgrade.  Do I run
> mythconverg_restore.pl <http://mythconverg_restore.pl> with defaults
> or include the drop and create arguments?  Also to be clear, I should
> restore the DB after installing myth but before running setup, right?

The last time I created fresh and wanted to restore from a good backup I
had just run on the old system, I did the following command:

/usr/share/mythtv/mythconverg_restore.pl --drop_database
--create_database --filename /full path to
directory/mythconverg-1214-20080626150513.sql.gz


Jim A
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sat, Jul 25, 2020 at 8:17 AM Jim Abernathy <jfabernathy@gmail.com> wrote:

>
> On 7/25/20 11:09 AM, DryHeat122 wrote:
>
> I am replacing my Ubuntu 16.04 setup with a clean install of Myth on a
> clean install of Utuntu 20.04. I have the old mythconverg backed up and am
> getting ready to restore. The wiki backend migration page
> <https://www.mythtv.org/wiki/Backend_migration> says "Depending on how
> your distribution initialises the database upon installation of the
> backend, you may need to use the procedure for replacing the database by
> the backup
> <https://www.mythtv.org/wiki/Database_Backup_and_Restore#Replacing_an_existing_database>."
>
>
> The referenced page says: " If you are replacing an existing database with
> a known-good backup by using a full restore--for example, because your
> database has been corrupted or a database schema upgrade failed or you're
> replacing a package-provided database with your "old" database after
> re-installing your distro--you will need to drop the existing database. "
>
> I don't know how 20.04 initializes the DB. I am not replacing the DB
> because of corruption or failed upgrade. Do I run mythconverg_restore.pl
> with defaults or include the drop and create arguments? Also to be clear,
> I should restore the DB after installing myth but before running setup,
> right?
>
> The last time I created fresh and wanted to restore from a good backup I
> had just run on the old system, I did the following command:
>
> /usr/share/mythtv/mythconverg_restore.pl --drop_database
> --create_database --filename /full path to
> directory/mythconverg-1214-20080626150513.sql.gz
>
>
> Jim A
>

Thanks. I tried that and it's denying me access to the database. The
--verbose option shows it has the right username, but says DBHostName,
DBUserName, and DBPassword are not defined and its expecting to find them
in the Mysql Options File. Not sure what options file it means or what
password to specify.
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sat, 25 Jul 2020 08:09:19 -0700, you wrote:

>I am replacing my Ubuntu 16.04 setup with a clean install of Myth on a
>clean install of Utuntu 20.04. I have the old mythconverg backed up and am
>getting ready to restore. The wiki backend migration page
><https://www.mythtv.org/wiki/Backend_migration> says "Depending on how your
>distribution initialises the database upon installation of the backend, you
>may need to use the procedure for replacing the database by the backup
><https://www.mythtv.org/wiki/Database_Backup_and_Restore#Replacing_an_existing_database>
>."
>
>The referenced page says: " If you are replacing an existing database with
>a known-good backup by using a full restore--for example, because your
>database has been corrupted or a database schema upgrade failed or you're
>replacing a package-provided database with your "old" database after
>re-installing your distro--you will need to drop the existing database. "
>
>I don't know how 20.04 initializes the DB. I am not replacing the DB
>because of corruption or failed upgrade. Do I run mythconverg_restore.pl
>with defaults or include the drop and create arguments? Also to be clear,
>I should restore the DB after installing myth but before running setup,
>right?

You want to do a full restore with drop and create. The other options
are for when you have a bad backup or partially corrupt database. When
you have a good backup of a full database, you always want to just
completely replace the existing database.

It does not matter if you want to run mythtv-setup first and play with
the empty database - anything you do will be overwritten with the
restored database.

You do want the MythTV packages installed before you restore your old
database. The packages set up the database system so that restoring
databases will work. See this file for the commands that get run to
set up the mythconverg database correctly:

/usr/share/mythtv/sql/mc.sql

If those commands are not run (if you create the mythconverg database
by restoring your backup before an existing mythconverg database has
been created), then the mythconverg database will not work correctly.
For example, its collating sequences will not be correct and data will
be listed and processed in the wrong order. If you ever need to
manually create a mythconverg database, use the mc.sql file:

sudo mysql
source /usr/share/mythtv/sql/mc.sql
quit

Then a backup can be restored over the newly created mythconverg
database and it will work correctly. This is part of what the
packages do when they are installed.

If you are copying your old config.xml files to the new system, then
you will need to run "sudo mysql" and do the necessary GRANT commands
to allow access using the user and password in the config.xml files.
Do that before restoring the old database - mythconverg_restore.pl
uses the config.xml files and restoring will fail if the config.xml
username/password does not match a GRANT.

After the restore, you immediately want to run mythtv-setup. That
ensures that any database schema upgrades necessary to run with the
version of MythTV on the new system will get done. If you are using
frontend only plugins like MythMusic, then you also need to run
mythfrontend to ensure they get schema upgrades done also.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Backend DB migration--replace or just restore? [ In reply to ]
On 7/25/20 10:55 AM, DryHeat122 wrote:
>
>
> On Sat, Jul 25, 2020 at 8:17 AM Jim Abernathy <jfabernathy@gmail.com <mailto:jfabernathy@gmail.com>> wrote:
>
>
> On 7/25/20 11:09 AM, DryHeat122 wrote:
>> I am replacing my Ubuntu 16.04 setup with a clean install of Myth on a clean install of Utuntu 20.04.  I have the old mythconverg backed
>> up and am getting ready to restore.  The wiki backend migration page <https://www.mythtv.org/wiki/Backend_migration> says "Depending on
>> how your distribution initialises the database upon installation of the backend, you may need to use the procedure for replacing the
>> database by the backup <https://www.mythtv.org/wiki/Database_Backup_and_Restore#Replacing_an_existing_database>."
>>
>> The referenced page says: " If you are replacing an existing database with a known-good backup by using a full restore--for example,
>> because your database has been corrupted or a database schema upgrade failed or you're replacing a package-provided database with your
>> "old" database after re-installing your distro--you will need to drop the existing database. "
>>
>> I don't know how 20.04 initializes the DB.  I am not replacing the DB because of corruption or failed upgrade.  Do I run
>> mythconverg_restore.pl <http://mythconverg_restore.pl> with defaults or include the drop and create arguments?  Also to be clear, I should
>> restore the DB after installing myth but before running setup, right?
>
> The last time I created fresh and wanted to restore from a good backup I had just run on the old system, I did the following command:
>
> /usr/share/mythtv/mythconverg_restore.pl <http://mythconverg_restore.pl> --drop_database --create_database --filename /full path to
> directory/mythconverg-1214-20080626150513.sql.gz
>
>
> Jim A
>
>
> Thanks.  I tried that and it's denying me access to the database.  The --verbose option shows it has the right username, but says DBHostName,
> DBUserName, and DBPassword are not defined and its expecting to find them in the Mysql Options File.  Not sure what options file it means or
> what password to specify.

The user running the program must have a valid config.xml. It falls back to the old mysql.txt and
those are the old variable names. It appears that neither was found (and mysql.txt hasn't been
used for years so that's good!).

Ubuntu packaging creates /etc/mythtv/config.xml and adds symbolic links to it from the login user
and mythtv user's ~/.mythtv/config.xml. At least, that's what it should do.

--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sat, Jul 25, 2020 at 9:14 AM Bill Meek <keemllib@gmail.com> wrote:

> On 7/25/20 10:55 AM, DryHeat122 wrote:
> >
> >
> > On Sat, Jul 25, 2020 at 8:17 AM Jim Abernathy <jfabernathy@gmail.com
> <mailto:jfabernathy@gmail.com>> wrote:
> >
> >
> > On 7/25/20 11:09 AM, DryHeat122 wrote:
> >> I am replacing my Ubuntu 16.04 setup with a clean install of Myth
> on a clean install of Utuntu 20.04. I have the old mythconverg backed
> >> up and am getting ready to restore. The wiki backend migration
> page <https://www.mythtv.org/wiki/Backend_migration> says "Depending on
> >> how your distribution initialises the database upon installation of
> the backend, you may need to use the procedure for replacing the
> >> database by the backup <
> https://www.mythtv.org/wiki/Database_Backup_and_Restore#Replacing_an_existing_database
> >."
> >>
> >> The referenced page says: " If you are replacing an existing
> database with a known-good backup by using a full restore--for example,
> >> because your database has been corrupted or a database schema
> upgrade failed or you're replacing a package-provided database with your
> >> "old" database after re-installing your distro--you will need to
> drop the existing database. "
> >>
> >> I don't know how 20.04 initializes the DB. I am not replacing the
> DB because of corruption or failed upgrade. Do I run
> >> mythconverg_restore.pl <http://mythconverg_restore.pl> with
> defaults or include the drop and create arguments? Also to be clear, I
> should
> >> restore the DB after installing myth but before running setup,
> right?
> >
> > The last time I created fresh and wanted to restore from a good
> backup I had just run on the old system, I did the following command:
> >
> > /usr/share/mythtv/mythconverg_restore.pl <
> http://mythconverg_restore.pl> --drop_database --create_database
> --filename /full path to
> > directory/mythconverg-1214-20080626150513.sql.gz
> >
> >
> > Jim A
> >
> >
> > Thanks. I tried that and it's denying me access to the database. The
> --verbose option shows it has the right username, but says DBHostName,
> > DBUserName, and DBPassword are not defined and its expecting to find
> them in the Mysql Options File. Not sure what options file it means or
> > what password to specify.
>
> The user running the program must have a valid config.xml. It falls back
> to the old mysql.txt and
> those are the old variable names. It appears that neither was found (and
> mysql.txt hasn't been
> used for years so that's good!).
>
> Ubuntu packaging creates /etc/mythtv/config.xml and adds symbolic links to
> it from the login user
> and mythtv user's ~/.mythtv/config.xml. At least, that's what it should do.
>
> --
> Bill
>

There is a valid config file in /home/mythtv/.mythtv and it has the
password for the db. The help on mythconverg_restore.pl says to create a
backuprc in ~/.mythtv, but on my machine ~ equals /home/steve, not
/home/mythtv. Also when running that script with --verbose it ways
MYTHCONFDIR is /home/steve/.mythtv and there is no such directory. So
there's the problem. I guess I could just create ~/.mythtv, but I don't
know why the installer put everything in /home/mythtv instead and I'm
worried this might lead to other problems down the line.
Re: Backend DB migration--replace or just restore? [ In reply to ]
On 7/25/20 11:28 AM, DryHeat122 wrote:
>
>
> On Sat, Jul 25, 2020 at 9:14 AM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com>> wrote:
>
> On 7/25/20 10:55 AM, DryHeat122 wrote:
> >
> >
> > On Sat, Jul 25, 2020 at 8:17 AM Jim Abernathy <jfabernathy@gmail.com <mailto:jfabernathy@gmail.com> <mailto:jfabernathy@gmail.com
> <mailto:jfabernathy@gmail.com>>> wrote:
> >
> >
> >     On 7/25/20 11:09 AM, DryHeat122 wrote:
> >>     I am replacing my Ubuntu 16.04 setup with a clean install of Myth on a clean install of Utuntu 20.04.  I have the old mythconverg backed
> >>     up and am getting ready to restore.  The wiki backend migration page <https://www.mythtv.org/wiki/Backend_migration> says "Depending on
> >>     how your distribution initialises the database upon installation of the backend, you may need to use the procedure for replacing the
> >>     database by the backup <https://www.mythtv.org/wiki/Database_Backup_and_Restore#Replacing_an_existing_database>."
> >>
> >>     The referenced page says: " If you are replacing an existing database with a known-good backup by using a full restore--for example,
> >>     because your database has been corrupted or a database schema upgrade failed or you're replacing a package-provided database with your
> >>     "old" database after re-installing your distro--you will need to drop the existing database. "
> >>
> >>     I don't know how 20.04 initializes the DB.  I am not replacing the DB because of corruption or failed upgrade.  Do I run
> >> mythconverg_restore.pl <http://mythconverg_restore.pl> <http://mythconverg_restore.pl> with defaults or include the drop and create
> arguments?  Also to be clear, I should
> >>     restore the DB after installing myth but before running setup, right?
> >
> >     The last time I created fresh and wanted to restore from a good backup I had just run on the old system, I did the following command:
> >
> >     /usr/share/mythtv/mythconverg_restore.pl <http://mythconverg_restore.pl> <http://mythconverg_restore.pl> --drop_database
> --create_database --filename /full path to
> >     directory/mythconverg-1214-20080626150513.sql.gz
> >
> >
> >     Jim A
> >
> >
> > Thanks.  I tried that and it's denying me access to the database.  The --verbose option shows it has the right username, but says
> DBHostName,
> > DBUserName, and DBPassword are not defined and its expecting to find them in the Mysql Options File.  Not sure what options file it means or
> > what password to specify.
>
> The user running the program must have a valid config.xml. It falls back to the old mysql.txt and
> those are the old variable names. It appears that neither was found (and mysql.txt hasn't been
> used for years so that's good!).
>
> Ubuntu packaging creates /etc/mythtv/config.xml and adds symbolic links to it from the login user
> and mythtv user's ~/.mythtv/config.xml. At least, that's what it should do.
>
> --
> Bill
>
>
> There is a valid config file in /home/mythtv/.mythtv and it has the password for the db.  The help on mythconverg_restore.pl
> <http://mythconverg_restore.pl> says to create a backuprc in ~/.mythtv, but on my machine ~ equals /home/steve, not /home/mythtv.  Also when
> running that script with --verbose it ways MYTHCONFDIR is /home/steve/.mythtv and there is no such directory.  So there's the problem.  I guess
> I could just create ~/.mythtv, but I don't know why the installer put everything in /home/mythtv instead and I'm worried this might lead to
> other problems down the line.

In the interest of getting the backup restored, you could become mythtv:

sudo --login --user=mythtv

backuprc can be added or the location can be specified on the command line with:

--directory some_directory

As to the missing .mythtv in /home/steve, try: sudo updatedb && locate -b "\config.xml
to see if the file exists for some other user (incl. root).

--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sat, Jul 25, 2020 at 10:07 AM Bill Meek <keemllib@gmail.com> wrote:

> On 7/25/20 11:28 AM, DryHeat122 wrote:
> >
> >
> > On Sat, Jul 25, 2020 at 9:14 AM Bill Meek <keemllib@gmail.com <mailto:
> keemllib@gmail.com>> wrote:
> >
> > On 7/25/20 10:55 AM, DryHeat122 wrote:
> > >
> > >
> > > On Sat, Jul 25, 2020 at 8:17 AM Jim Abernathy <
> jfabernathy@gmail.com <mailto:jfabernathy@gmail.com> <mailto:
> jfabernathy@gmail.com
> > <mailto:jfabernathy@gmail.com>>> wrote:
> > >
> > >
> > > On 7/25/20 11:09 AM, DryHeat122 wrote:
> > >> I am replacing my Ubuntu 16.04 setup with a clean install of
> Myth on a clean install of Utuntu 20.04. I have the old mythconverg backed
> > >> up and am getting ready to restore. The wiki backend
> migration page <https://www.mythtv.org/wiki/Backend_migration> says
> "Depending on
> > >> how your distribution initialises the database upon
> installation of the backend, you may need to use the procedure for
> replacing the
> > >> database by the backup <
> https://www.mythtv.org/wiki/Database_Backup_and_Restore#Replacing_an_existing_database
> >."
> > >>
> > >> The referenced page says: " If you are replacing an existing
> database with a known-good backup by using a full restore--for example,
> > >> because your database has been corrupted or a database
> schema upgrade failed or you're replacing a package-provided database with
> your
> > >> "old" database after re-installing your distro--you will
> need to drop the existing database. "
> > >>
> > >> I don't know how 20.04 initializes the DB. I am not
> replacing the DB because of corruption or failed upgrade. Do I run
> > >> mythconverg_restore.pl <http://mythconverg_restore.pl> <
> http://mythconverg_restore.pl> with defaults or include the drop and
> create
> > arguments? Also to be clear, I should
> > >> restore the DB after installing myth but before running
> setup, right?
> > >
> > > The last time I created fresh and wanted to restore from a
> good backup I had just run on the old system, I did the following command:
> > >
> > > /usr/share/mythtv/mythconverg_restore.pl <
> http://mythconverg_restore.pl> <http://mythconverg_restore.pl>
> --drop_database
> > --create_database --filename /full path to
> > > directory/mythconverg-1214-20080626150513.sql.gz
> > >
> > >
> > > Jim A
> > >
> > >
> > > Thanks. I tried that and it's denying me access to the
> database. The --verbose option shows it has the right username, but says
> > DBHostName,
> > > DBUserName, and DBPassword are not defined and its expecting to
> find them in the Mysql Options File. Not sure what options file it means or
> > > what password to specify.
> >
> > The user running the program must have a valid config.xml. It falls
> back to the old mysql.txt and
> > those are the old variable names. It appears that neither was found
> (and mysql.txt hasn't been
> > used for years so that's good!).
> >
> > Ubuntu packaging creates /etc/mythtv/config.xml and adds symbolic
> links to it from the login user
> > and mythtv user's ~/.mythtv/config.xml. At least, that's what it
> should do.
> >
> > --
> > Bill
> >
> >
> > There is a valid config file in /home/mythtv/.mythtv and it has the
> password for the db. The help on mythconverg_restore.pl
> > <http://mythconverg_restore.pl> says to create a backuprc in ~/.mythtv,
> but on my machine ~ equals /home/steve, not /home/mythtv. Also when
> > running that script with --verbose it ways MYTHCONFDIR is
> /home/steve/.mythtv and there is no such directory. So there's the
> problem. I guess
> > I could just create ~/.mythtv, but I don't know why the installer put
> everything in /home/mythtv instead and I'm worried this might lead to
> > other problems down the line.
>
> In the interest of getting the backup restored, you could become mythtv:
>
> sudo --login --user=mythtv
>
> backuprc can be added or the location can be specified on the command line
> with:
>
> --directory some_directory
>
> As to the missing .mythtv in /home/steve, try: sudo updatedb && locate -b
> "\config.xml
> to see if the file exists for some other user (incl. root).
>
> --
> Bill
>

That did it, thanks.
Re: Backend DB migration--replace or just restore? [ In reply to ]
On 7/25/20 2:03 PM, DryHeat122 wrote:
> sudo updatedb && locate -b "\config.xml

But did the above return anything other than the one in ~mythtv/.mythtv ?
Probably will be one in /usr/share too, but that's used during
installation.

--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sat, Jul 25, 2020 at 12:11 PM Bill Meek <keemllib@gmail.com> wrote:

> On 7/25/20 2:03 PM, DryHeat122 wrote:
> > sudo updatedb && locate -b "\config.xml
>
> But did the above return anything other than the one in ~mythtv/.mythtv ?
> Probably will be one in /usr/share too, but that's used during
> installation.
>
> --
> Bill
>
Yes there are config.xml files in /etc/mythtv,
/home/mythtv/.mythtv,/home/steve/.mythtv, and /usr/share/mythtv. This is
not good, it take it. Maybe it's why I can't run mythtv-setup as user
mythtv (in order to set up xmltv), something I just posted another thread
about.

Man this install is kicking my ass :-(
Re: Backend DB migration--replace or just restore? [ In reply to ]
On 7/25/20 2:26 PM, DryHeat122 wrote:
> On Sat, Jul 25, 2020 at 12:11 PM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com>> wrote:
>
> On 7/25/20 2:03 PM, DryHeat122 wrote:
> > sudo updatedb && locate -b "\config.xml
>
> But did the above return anything other than the one in ~mythtv/.mythtv ?
> Probably will be one in /usr/share too, but that's used during
> installation.
>
> --
> Bill
>
> Yes there are config.xml files in /etc/mythtv, /home/mythtv/.mythtv,/home/steve/.mythtv, and /usr/share/mythtv.  This is not good, it take it.
> Maybe it's why I can't run mythtv-setup as user mythtv (in order to set up xmltv), something I just posted another thread about.

That's *perfect*, maybe. The entries in ~ and ~mythtv should be symbolic links to
the one in /etc/mythtv. I'm asking because it's common for one of those links to
be broken and be replaced by a file and I've never been able to find out why.

This please:

ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml

--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sat, Jul 25, 2020 at 12:37 PM Bill Meek <keemllib@gmail.com> wrote:

> On 7/25/20 2:26 PM, DryHeat122 wrote:
> > On Sat, Jul 25, 2020 at 12:11 PM Bill Meek <keemllib@gmail.com <mailto:
> keemllib@gmail.com>> wrote:
> >
> > On 7/25/20 2:03 PM, DryHeat122 wrote:
> > > sudo updatedb && locate -b "\config.xml
> >
> > But did the above return anything other than the one in
> ~mythtv/.mythtv ?
> > Probably will be one in /usr/share too, but that's used during
> > installation.
> >
> > --
> > Bill
> >
> > Yes there are config.xml files in /etc/mythtv,
> /home/mythtv/.mythtv,/home/steve/.mythtv, and /usr/share/mythtv. This is
> not good, it take it.
> > Maybe it's why I can't run mythtv-setup as user mythtv (in order to set
> up xmltv), something I just posted another thread about.
>
> That's *perfect*, maybe. The entries in ~ and ~mythtv should be symbolic
> links to
> the one in /etc/mythtv. I'm asking because it's common for one of those
> links to
> be broken and be replaced by a file and I've never been able to find out
> why.
>
> This please:
>
> ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
>

-rw-rw---- 1 mythtv mythtv 452 Jul 25 07:54 /etc/mythtv/config.xml
lrwxrwxrwx 1 root root 22 Jul 25 07:54 /home/mythtv/.mythtv/config.xml
-> /etc/mythtv/config.xml
-rw-rw-r-- 1 steve steve 565 Jul 25 11:23 /home/steve/.mythtv/config.xml
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sat, Jul 25, 2020 at 12:41 PM DryHeat122 <dryheat122@gmail.com> wrote:

> On Sat, Jul 25, 2020 at 12:37 PM Bill Meek <keemllib@gmail.com> wrote:
>
>> On 7/25/20 2:26 PM, DryHeat122 wrote:
>> [snip]
>>
>> That's *perfect*, maybe. The entries in ~ and ~mythtv should be symbolic
>> links to
>> the one in /etc/mythtv. I'm asking because it's common for one of those
>> links to
>> be broken and be replaced by a file and I've never been able to find out
>> why.
>>
>> This please:
>>
>> ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
>>
>
> -rw-rw---- 1 mythtv mythtv 452 Jul 25 07:54 /etc/mythtv/config.xml
> lrwxrwxrwx 1 root root 22 Jul 25 07:54
> /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml
> -rw-rw-r-- 1 steve steve 565 Jul 25 11:23 /home/steve/.mythtv/config.xml
>
>

...You know, I'm thinking the mistake I made was not installing the OS as
user mythtv, and maybe I should just start over and do that.
Re: Backend DB migration--replace or just restore? [ In reply to ]
On 7/25/20 2:58 PM, DryHeat122 wrote:
>
>
> On Sat, Jul 25, 2020 at 12:41 PM DryHeat122 <dryheat122@gmail.com <mailto:dryheat122@gmail.com>> wrote:
>
> On Sat, Jul 25, 2020 at 12:37 PM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com>> wrote:
>
> On 7/25/20 2:26 PM, DryHeat122 wrote:
> [snip]
>
> That's *perfect*, maybe. The entries in ~ and ~mythtv should be symbolic links to
> the one in /etc/mythtv. I'm asking because it's common for one of those links to
> be broken and be replaced by a file and I've never been able to find out why.
>
> This please:
>
>    ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
>
>
> -rw-rw---- 1 mythtv mythtv 452 Jul 25 07:54 /etc/mythtv/config.xml
> lrwxrwxrwx 1 root   root    22 Jul 25 07:54 /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml
> -rw-rw-r-- 1 steve  steve  565 Jul 25 11:23 /home/steve/.mythtv/config.xml
>
> ...You know, I'm thinking the mistake I made was not installing the OS as user mythtv, and maybe I should just start over and do that.


I wouldn't start over. Note that /home/steve/.mythtv/config.xml is a file, not a
symbolic like like /home/mythtv/.mythtv/config.xml is. Also note that the two
files have different sizes. This *can* be OK as long as the DB credentials are
the same. This is where folks get in trouble. Common report is that the backend
runs OK, but the user can't start the frontend ('cause it connect to the DB.)

I'd rm /home/steve/.mythtv/config.xml and link it to /etc/mythtv/config.xml

ln -s /etc/mythtv/config.xml /home/steve/.mythtv/config.xml

*Assuming the backend is running OK*, proving that the data in /etc/mythtv/config.xml
is correct.

--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Backend DB migration--replace or just restore? [ In reply to ]
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.

\

On Sat, Jul 25, 2020 at 1:11 PM Bill Meek <keemllib@gmail.com> wrote:

> On 7/25/20 2:58 PM, DryHeat122 wrote:
> >
> >
> > On Sat, Jul 25, 2020 at 12:41 PM DryHeat122 <dryheat122@gmail.com
> <mailto:dryheat122@gmail.com>> wrote:
> >
> > On Sat, Jul 25, 2020 at 12:37 PM Bill Meek <keemllib@gmail.com
> <mailto:keemllib@gmail.com>> wrote:
> >
> > On 7/25/20 2:26 PM, DryHeat122 wrote:
> > [snip]
> >
> > That's *perfect*, maybe. The entries in ~ and ~mythtv should be
> symbolic links to
> > the one in /etc/mythtv. I'm asking because it's common for one
> of those links to
> > be broken and be replaced by a file and I've never been able to
> find out why.
> >
> > This please:
> >
> > ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
> >
> >
> > -rw-rw---- 1 mythtv mythtv 452 Jul 25 07:54 /etc/mythtv/config.xml
> > lrwxrwxrwx 1 root root 22 Jul 25 07:54
> /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml
> > -rw-rw-r-- 1 steve steve 565 Jul 25 11:23
> /home/steve/.mythtv/config.xml
> >
> > ...You know, I'm thinking the mistake I made was not installing the OS
> as user mythtv, and maybe I should just start over and do that.
>
>
> I wouldn't start over. Note that /home/steve/.mythtv/config.xml is a file,
> not a
> symbolic like like /home/mythtv/.mythtv/config.xml is. Also note that the
> two
> files have different sizes. This *can* be OK as long as the DB credentials
> are
> the same. This is where folks get in trouble. Common report is that the
> backend
> runs OK, but the user can't start the frontend ('cause it connect to the
> DB.)
>
> I'd rm /home/steve/.mythtv/config.xml and link it to /etc/mythtv/config.xml
>
> ln -s /etc/mythtv/config.xml /home/steve/.mythtv/config.xml
>
> *Assuming the backend is running OK*, proving that the data in
> /etc/mythtv/config.xml
> is correct.
>
> --
> Bill
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
Re: Backend DB migration--replace or just restore? [ In reply to ]
On 7/26/20 10:53 AM, DryHeat122 wrote:
>
> On Sat, Jul 25, 2020 at 1:11 PM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com>> wrote:
>
> On 7/25/20 2:58 PM, DryHeat122 wrote:
> >
> >
> > On Sat, Jul 25, 2020 at 12:41 PM DryHeat122 <dryheat122@gmail.com <mailto:dryheat122@gmail.com> <mailto:dryheat122@gmail.com
> <mailto:dryheat122@gmail.com>>> wrote:
> >
> >     On Sat, Jul 25, 2020 at 12:37 PM Bill Meek <keemllib@gmail.com <mailto:keemllib@gmail.com> <mailto:keemllib@gmail.com
> <mailto:keemllib@gmail.com>>> wrote:
> >
> >         On 7/25/20 2:26 PM, DryHeat122 wrote:
> >         [snip]
> >
> >         That's *perfect*, maybe. The entries in ~ and ~mythtv should be symbolic links to
> >         the one in /etc/mythtv. I'm asking because it's common for one of those links to
> >         be broken and be replaced by a file and I've never been able to find out why.
> >
> >         This please:
> >
> >             ls -ld /etc/mythtv/config.xml {~,~mythtv}/.mythtv/config.xml
> >
> >
> >     -rw-rw---- 1 mythtv mythtv 452 Jul 25 07:54 /etc/mythtv/config.xml
> >     lrwxrwxrwx 1 root   root    22 Jul 25 07:54 /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml
> >     -rw-rw-r-- 1 steve  steve  565 Jul 25 11:23 /home/steve/.mythtv/config.xml
> >
> > ...You know, I'm thinking the mistake I made was not installing the OS as user mythtv, and maybe I should just start over and do that.
>
>
> I wouldn't start over. Note that /home/steve/.mythtv/config.xml is a file, not a
> symbolic like like /home/mythtv/.mythtv/config.xml is. Also note that the two
> files have different sizes. This *can* be OK as long as the DB credentials are
> the same. This is where folks get in trouble. Common report is that the backend
> runs OK, but the user can't start the frontend ('cause it connect to the DB.)
>
> I'd rm /home/steve/.mythtv/config.xml and link it to /etc/mythtv/config.xml
>
>    ln -s /etc/mythtv/config.xml /home/steve/.mythtv/config.xml
>
> *Assuming the backend is running OK*, proving that the data in /etc/mythtv/config.xml
> is correct.
>
> --
> Bill

> 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
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sun, Jul 26, 2020 at 12:42 PM Bill Meek <keemllib@gmail.com> wrote:

> On 7/26/20 10:53 AM, DryHeat122 wrote:
> >
> > On Sat, Jul 25, 2020 at 1:11 PM Bill Meek <keemllib@gmail.com <mailto:
> keemllib@gmail.com>> wrote:
> >
> > On 7/25/20 2:58 PM, DryHeat122 wrote:
> > >
> > >
> > > On Sat, Jul 25, 2020 at 12:41 PM DryHeat122 <dryheat122@gmail.com
> <mailto:dryheat122@gmail.com> <mailto:dryheat122@gmail.com
> > <mailto:dryheat122@gmail.com>>> wrote:
> > >
> > > On Sat, Jul 25, 2020 at 12:37 PM Bill Meek <
> keemllib@gmail.com <mailto:keemllib@gmail.com> <mailto:keemllib@gmail.com
> > <mailto:keemllib@gmail.com>>> wrote:
> > >
> > > On 7/25/20 2:26 PM, DryHeat122 wrote:
> > > [snip]
> > >
> > > That's *perfect*, maybe. The entries in ~ and ~mythtv
> should be symbolic links to
> > > the one in /etc/mythtv. I'm asking because it's common
> for one of those links to
> > > be broken and be replaced by a file and I've never been
> able to find out why.
> > >
> > > This please:
> > >
> > > ls -ld /etc/mythtv/config.xml
> {~,~mythtv}/.mythtv/config.xml
> > >
> > >
> > > -rw-rw---- 1 mythtv mythtv 452 Jul 25 07:54
> /etc/mythtv/config.xml
> > > lrwxrwxrwx 1 root root 22 Jul 25 07:54
> /home/mythtv/.mythtv/config.xml -> /etc/mythtv/config.xml
> > > -rw-rw-r-- 1 steve steve 565 Jul 25 11:23
> /home/steve/.mythtv/config.xml
> > >
> > > ...You know, I'm thinking the mistake I made was not installing
> the OS as user mythtv, and maybe I should just start over and do that.
> >
> >
> > I wouldn't start over. Note that /home/steve/.mythtv/config.xml is a
> file, not a
> > symbolic like like /home/mythtv/.mythtv/config.xml is. Also note
> that the two
> > files have different sizes. This *can* be OK as long as the DB
> credentials are
> > the same. This is where folks get in trouble. Common report is that
> the backend
> > runs OK, but the user can't start the frontend ('cause it connect to
> the DB.)
> >
> > I'd rm /home/steve/.mythtv/config.xml and link it to
> /etc/mythtv/config.xml
> >
> > ln -s /etc/mythtv/config.xml /home/steve/.mythtv/config.xml
> >
> > *Assuming the backend is running OK*, proving that the data in
> /etc/mythtv/config.xml
> > is correct.
> >
> > --
> > Bill
>
> > 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
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sun, Jul 26, 2020 at 10:49 AM James Abernathy <jfabernathy@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.
Re: Backend DB migration--replace or just restore? [ In reply to ]
On 7/26/20 1:02 PM, DryHeat122 wrote:
>
>
> On Sun, Jul 26, 2020 at 10:49 AM James Abernathy <jfabernathy@gmail.com <mailto:jfabernathy@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

--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Backend DB migration--replace or just restore? [ In reply to ]
On 7/26/20 2:02 PM, DryHeat122 wrote:
>
>
> On Sun, Jul 26, 2020 at 10:49 AM James Abernathy
> <jfabernathy@gmail.com <mailto:jfabernathy@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.
>
First let me say that we all have ways that work for us.  I'm no
developer and I don't play one on TV.  However, I've been using mythtv
for a really long time and have developed a process that works for me.
First since I observe Ubuntu as the Linux of choice for mythtv, that's
what I use.  When I install I create the initial user as me, 'jim'.

After mythtv is installed I know the backend will run as user 'mythtv' 
and since the backend kicks off mythfilldatabase everyday then it will
be run as user 'mythtv'.  So I need my directories that the backend uses
for recordings, etc. to have the right permissions. Hence the sudo su
mythtv before I do the mkdirs for the backend files.

As to XMLTV.  the wiki says to run it as user 'mythtv' and that is what
I do. And by doing this I don't need a bunch of links to keep it working
a user 'jim'

As to mythtv-setup, since it needs to run with 'X' because of it's gui,
the easiest why is to run it as the initial user; 'jim' for me.
mythtv-setup also needs to be run by a user that is a part of the sudo
group (definitely in v31). Again easiest way is to run as initial user;
'jim' for me.

As to mythfilldatabase, it needs to be run as user 'mythtv' if run
manually.  However, during installation, after I complete mythtv-setup
and XMLTV, I just reboot.  That starts up mythtv-backend and after a few
minutes, mythfilldatabase seems to start on it's own.  If nothing
populates in the EPG after 10 minutes, I "sudo su mythtv" and then run
mythfilldatabase.

Jim A
Re: Backend DB migration--replace or just restore? [ In reply to ]
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?




On Sun, Jul 26, 2020 at 11:23 AM Jim Abernathy <jfabernathy@gmail.com>
wrote:

>
> On 7/26/20 2:02 PM, DryHeat122 wrote:
>
>
>
> On Sun, Jul 26, 2020 at 10:49 AM James Abernathy <jfabernathy@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.
>
> First let me say that we all have ways that work for us. I'm no developer
> and I don't play one on TV. However, I've been using mythtv for a really
> long time and have developed a process that works for me. First since I
> observe Ubuntu as the Linux of choice for mythtv, that's what I use. When
> I install I create the initial user as me, 'jim'.
>
> After mythtv is installed I know the backend will run as user 'mythtv'
> and since the backend kicks off mythfilldatabase everyday then it will be
> run as user 'mythtv'. So I need my directories that the backend uses for
> recordings, etc. to have the right permissions. Hence the sudo su mythtv
> before I do the mkdirs for the backend files.
>
> As to XMLTV. the wiki says to run it as user 'mythtv' and that is what I
> do. And by doing this I don't need a bunch of links to keep it working a
> user 'jim'
>
> As to mythtv-setup, since it needs to run with 'X' because of it's gui,
> the easiest why is to run it as the initial user; 'jim' for me.
> mythtv-setup also needs to be run by a user that is a part of the sudo
> group (definitely in v31). Again easiest way is to run as initial user;
> 'jim' for me.
>
> As to mythfilldatabase, it needs to be run as user 'mythtv' if run
> manually. However, during installation, after I complete mythtv-setup and
> XMLTV, I just reboot. That starts up mythtv-backend and after a few
> minutes, mythfilldatabase seems to start on it's own. If nothing populates
> in the EPG after 10 minutes, I "sudo su mythtv" and then run
> mythfilldatabase.
>
> Jim A
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sun, Jul 26, 2020 at 2:54 PM DryHeat122 <dryheat122@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
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Sun, 26 Jul 2020 14:59:41 -0400, you wrote:

>On Sun, Jul 26, 2020 at 2:54 PM DryHeat122 <dryheat122@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.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Mon, Jul 27, 2020 at 2:36 AM Stephen Worthington <
stephen_agent@jsw.gen.nz> wrote:

> On Sun, 26 Jul 2020 14:59:41 -0400, you wrote:
>
>
> 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.
>

I followed Jim's advice and things seem to be set up this way now. I must
say, I don't get why Myth was designed this way, with config files
sprinkled all over the place. Seems like one ought to suffice. But
whatever.
Re: Backend DB migration--replace or just restore? [ In reply to ]
On Mon, 27 Jul 2020 07:48:28 -0700, you wrote:

>On Mon, Jul 27, 2020 at 2:36 AM Stephen Worthington <
>stephen_agent@jsw.gen.nz> wrote:
>
>> On Sun, 26 Jul 2020 14:59:41 -0400, you wrote:
>>
>>
>> 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.
>>
>
>I followed Jim's advice and things seem to be set up this way now. I must
>say, I don't get why Myth was designed this way, with config files
>sprinkled all over the place. Seems like one ought to suffice. But
>whatever.

Having a separate config.xml file for each user allows mythfrontend to
be pointed to a different backend. I do this to connect to the
backend on my mother's MythTV box and to the one on my test PC.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org

1 2  View All