Help with Database Import (Incorrect Databse Schema Error)

For discussion of topics specific to MythTV on linux
mattlach
Junior
Posts: 89
Joined: Wed Jun 11, 2014 2:52 am
United States of America

Re: Help with Database Import (Incorrect Databse Schema Error)

Post by mattlach » Wed Aug 14, 2019 1:04 am

Alright, for all of this talk of a lengthy conversion, mine took less than two minutes for a 1.2GB database backup (uncompressed).

I hope that is more of an indication of my awesome hardware and setup (running off of a mirrored pair of SSD's using ZFS, so in reality likely all in RAM cache on a pair of Xeon E5-2650 V2's with 6 cores allocated to the MythTV backend) and not an indication that something failed.

I do have a little problem though. The mytthtv setup program is displaying the time in UTC. This can't be good when I want to schedule programming in EST. Hopefully this is just because I failed to set my tzdata.
MythTV 30 in 18.04 LTS w. LXDE, running in LXC Container on Proxmox VE Server. Dual Octacore Xeon E5-2650v2, 256GB RAM

mattlach
Junior
Posts: 89
Joined: Wed Jun 11, 2014 2:52 am
United States of America

Re: Help with Database Import (Incorrect Databse Schema Error)

Post by mattlach » Wed Aug 14, 2019 1:19 am

Hmm. Not everything has been reimported when restoring my database.

It has - for instance - remembered my schedules direct settings and login information, but all of my tuners are gone :/

All of my configured storage directories are gone as well.

Is this typical?

I've never reimported a database before, so I don't know what to expect there to have been reimported.

I'm a little worried because the database conversion went so fast.

Hopefully all of my old recordings are still there. The significant other will be displeased if some of her stuff has gone missing :/
MythTV 30 in 18.04 LTS w. LXDE, running in LXC Container on Proxmox VE Server. Dual Octacore Xeon E5-2650v2, 256GB RAM

mattlach
Junior
Posts: 89
Joined: Wed Jun 11, 2014 2:52 am
United States of America

Re: Help with Database Import (Incorrect Databse Schema Error)

Post by mattlach » Wed Aug 14, 2019 2:12 am

Alright, the good news is everything seems to be working!

All of my recordings are there, playing back and live TV are both functioning as expected!

The still image previews in mythweb are broken, but I wonder if that's just because the backend is (slowly) recreating them). They aren't terribly important, but it looks kind of broken without them.

I wonder what will happen after my nightly database backup, optimize_mythdb.pl and flush_deleted_recgroup.pl script runs.
mythweb-recordings.png
mythweb-recordings.png (100.99 KiB) Viewed 104 times
Another thing that isn't terribly important but looks weird is that I found those missing TV tuners from the restored database. They are still there in mythweb, now listed as disconnected. Thing is, they are nowhere to be found in mythtv-setup, so I can't seem to remove them.
mythweb-tuners.png
mythweb-tuners.png (51.6 KiB) Viewed 105 times
Any idea how I might accomplish this?

Thank you very much!
MythTV 30 in 18.04 LTS w. LXDE, running in LXC Container on Proxmox VE Server. Dual Octacore Xeon E5-2650v2, 256GB RAM

User avatar
bill6502
Developer
Posts: 1356
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Help with Database Import (Incorrect Databse Schema Error)

Post by bill6502 » Wed Aug 14, 2019 2:23 am

When tuners 'vanish' it's frequently that the hostname changed. The hostname is
also a profile name Could be that the tuners are really there, just with a different
hostname.

mattlach
Junior
Posts: 89
Joined: Wed Jun 11, 2014 2:52 am
United States of America

Re: Help with Database Import (Incorrect Databse Schema Error)

Post by mattlach » Wed Aug 14, 2019 2:27 am

bill6502 wrote:
Wed Aug 14, 2019 2:23 am
When tuners 'vanish' it's frequently that the hostname changed. The hostname is
also a profile name Could be that the tuners are really there, just with a different
hostname.
Hmm.

Thank you. How would I go about fixing that? You know removing the old ones?

I don't even recall what the old hostname would have been. I assumed that would have been carried forth in my database backup., so I assumed what was there when I went through he config screens was the same as it was before.

Any hints you can give me would be appreciated. I've never used the profile features so I am not really sure what they do.
MythTV 30 in 18.04 LTS w. LXDE, running in LXC Container on Proxmox VE Server. Dual Octacore Xeon E5-2650v2, 256GB RAM

User avatar
bill6502
Developer
Posts: 1356
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Help with Database Import (Incorrect Databse Schema Error)

Post by bill6502 » Wed Aug 14, 2019 2:49 am

There isn't a profile feature, it's just that the hostname is used as one. In the
settings table, for example you'll see the hostname. It's entered automatically,
you don't normally take action. There is a way to force a hostname (profile name)
in config.xml. It's normally not recommended, but I've used it. You'd need to be
sure that everything uses/links to the same config.xml and put the old hostname
in here: <LocalHostName>my-unique-identifier-goes-here</LocalHostName>

Looking at the 2nd picture above, I'd guess that the old hostname was mythbuntu
and the new hostname is mythtv. The remote tuners look old, because they have
IP addresses 10.0.3.3, while the others look proper with output of hdhomerun_config discover
and I'd most likely delete the old ones and re-add them.

That's not to say there aren't other leftovers. Or could it be that you've done setup work
on the new hostname rather than renaming the host to match the old values in the DB?

mattlach
Junior
Posts: 89
Joined: Wed Jun 11, 2014 2:52 am
United States of America

Re: Help with Database Import (Incorrect Databse Schema Error)

Post by mattlach » Wed Aug 14, 2019 3:07 am

bill6502 wrote:
Wed Aug 14, 2019 2:49 am
There isn't a profile feature, it's just that the hostname is used as one. In the
settings table, for example you'll see the hostname. It's entered automatically,
you don't normally take action. There is a way to force a hostname (profile name)
in config.xml. It's normally not recommended, but I've used it. You'd need to be
sure that everything uses/links to the same config.xml and put the old hostname
in here: <LocalHostName>my-unique-identifier-goes-here</LocalHostName>

Looking at the 2nd picture above, I'd guess that the old hostname was mythbuntu
and the new hostname is mythtv. The remote tuners look old, because they have
IP addresses 10.0.3.3, while the others look proper with output of hdhomerun_config discover
and I'd most likely delete the old ones and re-add them.

That's not to say there aren't other leftovers. Or could it be that you've done setup work
on the new hostname rather than renaming the host to match the old values in the DB?
I ran setup right after importing the old database and converting it to the new schema. The old tuners and new tuners in that list are the exact same tuners on the exact same IP addresses, just duplicate entries, 6 of them working (the new ones, tuners 13-18) and six of them not (the old ones, tuners 1,3,5,7,9 and 11).

Ideally, I'd just remove the old ones and move on with my life, since everything seems to be working now. Is there a way to do that easily, or would I have to rename the hostname to the old hostname, delete the tuners, and then rename it back?

Are there any risks when it comes to leaving the old duplicates there? Will they fight with the new ones in any way and cause problems?

While I'd ideally like them gone, if it's going to be another big "risk of breaking something" hullaballoo, I'd just as soon leave them.

While I am a pretty seasoned Linux user, I don't claim to understand how all this MySQL stuff works. I don't fully understand it, and every time I touch it it seems to break something, so I am apprehensive.
MythTV 30 in 18.04 LTS w. LXDE, running in LXC Container on Proxmox VE Server. Dual Octacore Xeon E5-2650v2, 256GB RAM

mattlach
Junior
Posts: 89
Joined: Wed Jun 11, 2014 2:52 am
United States of America

Re: Help with Database Import (Incorrect Databse Schema Error)

Post by mattlach » Thu Aug 15, 2019 12:29 am

bill6502 wrote:
Wed Aug 14, 2019 2:23 am
When tuners 'vanish' it's frequently that the hostname changed. The hostname is
also a profile name Could be that the tuners are really there, just with a different
hostname.
Alright,

so I snapshotted the root drive of my backend so I can roll back if I break anything and got to work, and seeing the menu again made me remember some details.

If you recall your post above where you asked me to make sure the master backend checkbox was checked?
bill6502 wrote:
Tue Aug 13, 2019 8:13 pm
A slave backend can't update the DB.

See:

mythtv-setup-> General->Host Address Backend Setup->This server is the Master Backend

Make sure it's checked.
Well, before checking that box, my old hostname was in the hostname field. As soon as I checked that box, it automatically changed itself to "mythtv" and now it cannot be changed. If I scroll down it just rolls around and goes back to the top of the menu, not allowing me to edit it. It does not matter if the "master backend" checkbox is checked or not.

Either way, this is a moot point. This all happened because I forgot the last step in the Backend Migration guide. Apparently you are supposed to delete your tuners BEFORE exporting the last database out of the old backend. Whoops. I never did this. I had read that page when I started this project back in April, but many delays later and I forgot all about it.

So, I decided to delete all tuners, reconfigure them, and save the database. The "phantom tuners" are now gone, and everything is as expected.


Except those broken preview images on old recordings...
mythweb-recordings.png
mythweb-recordings.png (100.99 KiB) Viewed 83 times
Is there any way to make the backend rebuild all preview images?
MythTV 30 in 18.04 LTS w. LXDE, running in LXC Container on Proxmox VE Server. Dual Octacore Xeon E5-2650v2, 256GB RAM

Post Reply