Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

Question about using backup myth mysql dumps...

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


stuart at xnet

Nov 22, 2009, 9:28 AM

Post #1 of 10 (1079 views)
Permalink
Question about using backup myth mysql dumps...

Hi...

In my hast, I have created a bunch of orphaned recordings (100+).
Information about them still exists in the old mythtv data base, but I
think putting the old mythtv data base back into mysql would be a
mistake as the data base dump is months old. So, I've come to the
conclusion the best thing to do is wade through the recordings, rename
the keepers to something a human can read and place them into a mythtv
video directory.

However, I can't help but think it might be possible to still use the
old mythtv data base dump to rename these files to something a human can
read! (That would be waaaay faster then spot checking them with video
player!)

Anyone have ideas on how to do this (i.e. use an old mysql data base
dump to rename mythtv recordings)?

-thanks!
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Nov 22, 2009, 4:12 PM

Post #2 of 10 (1041 views)
Permalink
Re: Question about using backup myth mysql dumps... [In reply to]

On 11/22/2009 12:28 PM, stuart wrote:
> In my hast, I have created a bunch of orphaned recordings (100+).
> Information about them still exists in the old mythtv data base, but I
> think putting the old mythtv data base back into mysql would be a
> mistake as the data base dump is months old. So, I've come to the
> conclusion the best thing to do is wade through the recordings, rename
> the keepers to something a human can read and place them into a mythtv
> video directory.
>
> However, I can't help but think it might be possible to still use the
> old mythtv data base dump to rename these files to something a human
> can read! (That would be waaaay faster then spot checking them with
> video player!)
>
> Anyone have ideas on how to do this (i.e. use an old mysql data base
> dump to rename mythtv recordings)?

I'd argue that it would be better, easier, and you'd retain more and
better information if you restored the old database, then went through
and deleted all the shows whose files are missing.

It's a one-time process, the end result will be a database as clean as
one that had never had any orphaned recordings, and you'll save a lot of
time reconfiguring and a /ton/ of time trying to get the old recordings
back into Myth.

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


nick.rout at gmail

Nov 22, 2009, 4:41 PM

Post #3 of 10 (1051 views)
Permalink
Re: Question about using backup myth mysql dumps... [In reply to]

On Mon, Nov 23, 2009 at 1:12 PM, Michael T. Dean
<mtdean [at] thirdcontact> wrote:
> On 11/22/2009 12:28 PM, stuart wrote:
>> In my hast, I have created a bunch of orphaned recordings (100+).
>> Information about them still exists in the old mythtv data base, but I
>> think putting the old mythtv data base back into mysql would be a
>> mistake as the data base dump is months old. So, I've come to the
>> conclusion the best thing to do is wade through the recordings, rename
>> the keepers to something a human can read and place them into a mythtv
>> video directory.
>>
>> However, I can't help but think it might be possible to still use the
>> old mythtv data base dump to rename these files to something a human
>> can read!  (That would be waaaay faster then spot checking them with
>> video player!)
>>
>> Anyone have ideas on how to do this (i.e. use an old mysql data base
>> dump to rename mythtv recordings)?
>
> I'd argue that it would be better, easier, and you'd retain more and
> better information if you restored the old database, then went through
> and deleted all the shows whose files are missing.

But what about shows that have been added into the database since the
old database was backed up?
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Nov 22, 2009, 4:52 PM

Post #4 of 10 (1035 views)
Permalink
Re: Question about using backup myth mysql dumps... [In reply to]

On 11/22/2009 07:41 PM, Nick Rout wrote:
> On Mon, Nov 23, 2009 at 1:12 PM, Michael T. Dean
> <mtdean [at] thirdcontact> wrote:
>
>> On 11/22/2009 12:28 PM, stuart wrote:
>>
>>> In my hast, I have created a bunch of orphaned recordings (100+).
>>> Information about them still exists in the old mythtv data base, but I
>>> think putting the old mythtv data base back into mysql would be a
>>> mistake as the data base dump is months old. So, I've come to the
>>> conclusion the best thing to do is wade through the recordings, rename
>>> the keepers to something a human can read and place them into a mythtv
>>> video directory.
>>>
>>> However, I can't help but think it might be possible to still use the
>>> old mythtv data base dump to rename these files to something a human
>>> can read! (That would be waaaay faster then spot checking them with
>>> video player!)
>>>
>>> Anyone have ideas on how to do this (i.e. use an old mysql data base
>>> dump to rename mythtv recordings)?
>>>
>> I'd argue that it would be better, easier, and you'd retain more and
>> better information if you restored the old database, then went through
>> and deleted all the shows whose files are missing.
>>
>
> But what about shows that have been added into the database since the
> old database was backed up?

Don't you have a current database you can just back up?

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Nov 22, 2009, 7:30 PM

Post #5 of 10 (1030 views)
Permalink
Re: Question about using backup myth mysql dumps... [In reply to]

On 11/22/2009 10:34 PM, stuart wrote:
> Michael T. Dean wrote:
>> On 11/22/2009 07:41 PM, Nick Rout wrote:
>>> On Mon, Nov 23, 2009 at 1:12 PM, Michael T. Dean wrote:
>>>> On 11/22/2009 12:28 PM, stuart wrote:
>>>>> In my hast, I have created a bunch of orphaned recordings (100+).
>>>>> Information about them still exists in the old mythtv data base,
>>>>> but I
>>>>> think putting the old mythtv data base back into mysql would be a
>>>>> mistake as the data base dump is months old. So, I've come to the
>>>>> conclusion the best thing to do is wade through the recordings,
>>>>> rename
>>>>> the keepers to something a human can read and place them into a
>>>>> mythtv
>>>>> video directory.
>>>>>
>>>>> However, I can't help but think it might be possible to still use the
>>>>> old mythtv data base dump to rename these files to something a human
>>>>> can read! (That would be waaaay faster then spot checking them with
>>>>> video player!)
>>>>>
>>>>> Anyone have ideas on how to do this (i.e. use an old mysql data base
>>>>> dump to rename mythtv recordings)?
>>>>>
>>>> I'd argue that it would be better, easier, and you'd retain more and
>>>> better information if you restored the old database, then went through
>>>> and deleted all the shows whose files are missing.
>>>>
>>>
>>> But what about shows that have been added into the database since the
>>> old database was backed up?
>>
>> Don't you have a current database you can just back up?
>
> Why yes, but ... I don't remember seeing any mythtv howto's on merging
> old and new data base dumps.
>
> Also, (didn't want to bore you) I have cleaned up the recording rules
> a fair bit since the old data base dump (seams a lot of people were
> just pressing "record" in the program listings creating multiple rules
> for the same shows!).
>
> A friend suggested there might be a way to harvest each orphaned
> recording's information from the old data base and use "INSERT" to
> place the information into the new data base. It is trivial to create
> a clean list of orphaned recording files. What I don't know is how to
> extract from the old dump and insert into the new.

So the orphans are orphaned files for which someone deleted your
database metadata?

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


stuart at xnet

Nov 22, 2009, 7:34 PM

Post #6 of 10 (1032 views)
Permalink
Re: Question about using backup myth mysql dumps... [In reply to]

Michael T. Dean wrote:
> On 11/22/2009 07:41 PM, Nick Rout wrote:
>> On Mon, Nov 23, 2009 at 1:12 PM, Michael T. Dean
>> <mtdean [at] thirdcontact> wrote:
>>
>>> On 11/22/2009 12:28 PM, stuart wrote:
>>>
>>>> In my hast, I have created a bunch of orphaned recordings (100+).
>>>> Information about them still exists in the old mythtv data base, but I
>>>> think putting the old mythtv data base back into mysql would be a
>>>> mistake as the data base dump is months old. So, I've come to the
>>>> conclusion the best thing to do is wade through the recordings, rename
>>>> the keepers to something a human can read and place them into a mythtv
>>>> video directory.
>>>>
>>>> However, I can't help but think it might be possible to still use the
>>>> old mythtv data base dump to rename these files to something a human
>>>> can read! (That would be waaaay faster then spot checking them with
>>>> video player!)
>>>>
>>>> Anyone have ideas on how to do this (i.e. use an old mysql data base
>>>> dump to rename mythtv recordings)?
>>>>
>>> I'd argue that it would be better, easier, and you'd retain more and
>>> better information if you restored the old database, then went through
>>> and deleted all the shows whose files are missing.
>>>
>>
>> But what about shows that have been added into the database since the
>> old database was backed up?
>
> Don't you have a current database you can just back up?

Why yes, but ... I don't remember seeing any mythtv howto's on merging
old and new data base dumps.

Also, (didn't want to bore you) I have cleaned up the recording rules a
fair bit since the old data base dump (seams a lot of people were just
pressing "record" in the program listings creating multiple rules for
the same shows!).

A friend suggested there might be a way to harvest each orphaned
recording's information from the old data base and use "INSERT" to place
the information into the new data base. It is trivial to create a clean
list of orphaned recording files. What I don't know is how to extract
from the old dump and insert into the new.




_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


stuart at xnet

Nov 22, 2009, 8:10 PM

Post #7 of 10 (1040 views)
Permalink
Re: Question about using backup myth mysql dumps... [In reply to]

Michael T. Dean wrote:
> On 11/22/2009 10:34 PM, stuart wrote:
>> Michael T. Dean wrote:
>>> On 11/22/2009 07:41 PM, Nick Rout wrote:
>>>> On Mon, Nov 23, 2009 at 1:12 PM, Michael T. Dean wrote:
>>>>> On 11/22/2009 12:28 PM, stuart wrote:
>>>>>> In my hast, I have created a bunch of orphaned recordings (100+).
>>>>>> Information about them still exists in the old mythtv data base,
>>>>>> but I
>>>>>> think putting the old mythtv data base back into mysql would be a
>>>>>> mistake as the data base dump is months old. So, I've come to the
>>>>>> conclusion the best thing to do is wade through the recordings,
>>>>>> rename
>>>>>> the keepers to something a human can read and place them into a
>>>>>> mythtv
>>>>>> video directory.
>>>>>>
>>>>>> However, I can't help but think it might be possible to still use the
>>>>>> old mythtv data base dump to rename these files to something a human
>>>>>> can read! (That would be waaaay faster then spot checking them with
>>>>>> video player!)
>>>>>>
>>>>>> Anyone have ideas on how to do this (i.e. use an old mysql data base
>>>>>> dump to rename mythtv recordings)?
>>>>>>
>>>>> I'd argue that it would be better, easier, and you'd retain more and
>>>>> better information if you restored the old database, then went through
>>>>> and deleted all the shows whose files are missing.
>>>>>
>>>>
>>>> But what about shows that have been added into the database since the
>>>> old database was backed up?
>>>
>>> Don't you have a current database you can just back up?
>>
>> Why yes, but ... I don't remember seeing any mythtv howto's on merging
>> old and new data base dumps.
>>
>> Also, (didn't want to bore you) I have cleaned up the recording rules
>> a fair bit since the old data base dump (seams a lot of people were
>> just pressing "record" in the program listings creating multiple rules
>> for the same shows!).
>>
>> A friend suggested there might be a way to harvest each orphaned
>> recording's information from the old data base and use "INSERT" to
>> place the information into the new data base. It is trivial to create
>> a clean list of orphaned recording files. What I don't know is how to
>> extract from the old dump and insert into the new.
>
> So the orphans are orphaned files for which someone deleted your
> database metadata?
>
> Mike

Yes,
I most likely ran myth.find_orphans.pl w/the
delete-data-base-entry-if-you-cant-find-a-file option and somehow erased
the data base entries of 100+ files. Since then I have spent time
cleaning up my recording rules plus now there are 2 months of fresh
recordings in the data base. I find it tantalizing that information
still exists for these orphaned recordings in older data base dumps.
But I am not sure how to selectively move each recording's information
forward into the new data base.








_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


nick.rout at gmail

Nov 23, 2009, 12:04 AM

Post #8 of 10 (1018 views)
Permalink
Re: Question about using backup myth mysql dumps... [In reply to]

On Mon, Nov 23, 2009 at 5:10 PM, stuart <stuart [at] xnet> wrote:
>
>
> Michael T. Dean wrote:
>>
>> On 11/22/2009 10:34 PM, stuart wrote:
>>>
>>> Michael T. Dean wrote:
>>>>
>>>> On 11/22/2009 07:41 PM, Nick Rout wrote:
>>>>>
>>>>> On Mon, Nov 23, 2009 at 1:12 PM, Michael T. Dean  wrote:
>>>>>>
>>>>>> On 11/22/2009 12:28 PM, stuart wrote:
>>>>>>>
>>>>>>> In my hast, I have created a bunch of orphaned recordings (100+).
>>>>>>> Information about them still exists in the old mythtv data base, but
>>>>>>> I
>>>>>>> think putting the old mythtv data base back into mysql would be a
>>>>>>> mistake as the data base dump is months old. So, I've come to the
>>>>>>> conclusion the best thing to do is wade through the recordings,
>>>>>>> rename
>>>>>>> the keepers to something a human can read and place them into a
>>>>>>> mythtv
>>>>>>> video directory.
>>>>>>>
>>>>>>> However, I can't help but think it might be possible to still use the
>>>>>>> old mythtv data base dump to rename these files to something a human
>>>>>>> can read!  (That would be waaaay faster then spot checking them with
>>>>>>> video player!)
>>>>>>>
>>>>>>> Anyone have ideas on how to do this (i.e. use an old mysql data base
>>>>>>> dump to rename mythtv recordings)?
>>>>>>>
>>>>>>
>>>>>> I'd argue that it would be better, easier, and you'd retain more and
>>>>>> better information if you restored the old database, then went through
>>>>>> and deleted all the shows whose files are missing.
>>>>>>
>>>>>
>>>>> But what about shows that have been added into the database since the
>>>>> old database was backed up?
>>>>
>>>> Don't you have a current database you can just back up?
>>>
>>> Why yes, but ... I don't remember seeing any mythtv howto's on merging
>>> old and new data base dumps.
>>>
>>> Also, (didn't want to bore you) I have cleaned up the recording rules a
>>> fair bit since the old data base dump (seams a lot of people were just
>>> pressing "record" in the program listings creating multiple rules for the
>>> same shows!).
>>>
>>> A friend suggested there might be a way to harvest each orphaned
>>> recording's information from the old data base and use "INSERT" to place the
>>> information into the new data base.  It is trivial to create a clean list of
>>> orphaned recording files.  What I don't know is how to extract from the old
>>> dump and insert into the new.
>>
>> So the orphans are orphaned files for which someone deleted your database
>> metadata?
>>
>> Mike
>
> Yes,
> I most likely ran myth.find_orphans.pl w/the
> delete-data-base-entry-if-you-cant-find-a-file option and somehow erased the
> data base entries of 100+ files. Since then I have spent time cleaning up my
> recording rules plus now there are 2 months of fresh recordings in the data
> base. I find it tantalizing that information still exists for these orphaned
> recordings in older data base dumps. But I am not sure how to selectively
> move each recording's information forward into the new data base.

Have you changed mythtv versions or gone to a new database schema
since the backup?

If not you can probably use

myth.find_orphans.pl|grep unknown

to get a list of the orphaned files, then massage the filenames and
then write some sort of script to extract the appropriate lines from
from the recorded table in the backup, then insert those lines in your
current database.

I would proceed slowly and experimentally with plenty of backups of
your last known working database!!

It should be a relatively simple script, but don't ask me to do it!

One caution: I don't know what tables other than 'recorded' should
affected when you add the entries back!
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


stuart at xnet

Nov 23, 2009, 4:37 AM

Post #9 of 10 (998 views)
Permalink
Re: Question about using backup myth mysql dumps... [In reply to]

Nick Rout wrote:
> On Mon, Nov 23, 2009 at 5:10 PM, stuart <stuart [at] xnet> wrote:
>>
>> Michael T. Dean wrote:
>>> On 11/22/2009 10:34 PM, stuart wrote:
>>>> Michael T. Dean wrote:
>>>>> On 11/22/2009 07:41 PM, Nick Rout wrote:
>>>>>> On Mon, Nov 23, 2009 at 1:12 PM, Michael T. Dean wrote:
>>>>>>> On 11/22/2009 12:28 PM, stuart wrote:
>>>>>>>> In my hast, I have created a bunch of orphaned recordings (100+).
>>>>>>>> Information about them still exists in the old mythtv data base, but
>>>>>>>> I
>>>>>>>> think putting the old mythtv data base back into mysql would be a
>>>>>>>> mistake as the data base dump is months old. So, I've come to the
>>>>>>>> conclusion the best thing to do is wade through the recordings,
>>>>>>>> rename
>>>>>>>> the keepers to something a human can read and place them into a
>>>>>>>> mythtv
>>>>>>>> video directory.
>>>>>>>>
>>>>>>>> However, I can't help but think it might be possible to still use the
>>>>>>>> old mythtv data base dump to rename these files to something a human
>>>>>>>> can read! (That would be waaaay faster then spot checking them with
>>>>>>>> video player!)
>>>>>>>>
>>>>>>>> Anyone have ideas on how to do this (i.e. use an old mysql data base
>>>>>>>> dump to rename mythtv recordings)?
>>>>>>>>
>>>>>>> I'd argue that it would be better, easier, and you'd retain more and
>>>>>>> better information if you restored the old database, then went through
>>>>>>> and deleted all the shows whose files are missing.
>>>>>>>
>>>>>> But what about shows that have been added into the database since the
>>>>>> old database was backed up?
>>>>> Don't you have a current database you can just back up?
>>>> Why yes, but ... I don't remember seeing any mythtv howto's on merging
>>>> old and new data base dumps.
>>>>
>>>> Also, (didn't want to bore you) I have cleaned up the recording rules a
>>>> fair bit since the old data base dump (seams a lot of people were just
>>>> pressing "record" in the program listings creating multiple rules for the
>>>> same shows!).
>>>>
>>>> A friend suggested there might be a way to harvest each orphaned
>>>> recording's information from the old data base and use "INSERT" to place the
>>>> information into the new data base. It is trivial to create a clean list of
>>>> orphaned recording files. What I don't know is how to extract from the old
>>>> dump and insert into the new.
>>> So the orphans are orphaned files for which someone deleted your database
>>> metadata?
>>>
>>> Mike
>> Yes,
>> I most likely ran myth.find_orphans.pl w/the
>> delete-data-base-entry-if-you-cant-find-a-file option and somehow erased the
>> data base entries of 100+ files. Since then I have spent time cleaning up my
>> recording rules plus now there are 2 months of fresh recordings in the data
>> base. I find it tantalizing that information still exists for these orphaned
>> recordings in older data base dumps. But I am not sure how to selectively
>> move each recording's information forward into the new data base.
>
> Have you changed mythtv versions or gone to a new database schema
> since the backup?

I don't believe I have (data base). I have not moved to the new version
of mythtv yet.

> If not you can probably use
>
> myth.find_orphans.pl|grep unknown

This is what I have been using. It give a clean list of orphaned
recording file names:

myth.find_orphans.pl | grep -v .png | grep .mpg | cut -d' ' -f4 | cut
-d/ -f4

> to get a list of the orphaned files, then massage the filenames and
> then write some sort of script ...

Yes, that's the part I did not understand either.

-thanks for your help.

_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


lists at manor-farm

Nov 23, 2009, 7:35 AM

Post #10 of 10 (996 views)
Permalink
Re: Question about using backup myth mysql dumps... [In reply to]

stuart wrote:
>
>
> Nick Rout wrote:
>> On Mon, Nov 23, 2009 at 5:10 PM, stuart <stuart [at] xnet> wrote:
>>>
>>> Michael T. Dean wrote:
>>>> On 11/22/2009 10:34 PM, stuart wrote:
>>>>> Michael T. Dean wrote:
>>>>>> On 11/22/2009 07:41 PM, Nick Rout wrote:
>>>>>>> On Mon, Nov 23, 2009 at 1:12 PM, Michael T. Dean wrote:
>>>>>>>> On 11/22/2009 12:28 PM, stuart wrote:
>>>>>>>>> In my hast, I have created a bunch of orphaned recordings (100+).
>>>>>>>>> Information about them still exists in the old mythtv data
>>>>>>>>> base, but
>>>>>>>>> I
>>>>>>>>> think putting the old mythtv data base back into mysql would be a
>>>>>>>>> mistake as the data base dump is months old. So, I've come to the
>>>>>>>>> conclusion the best thing to do is wade through the recordings,
>>>>>>>>> rename
>>>>>>>>> the keepers to something a human can read and place them into a
>>>>>>>>> mythtv
>>>>>>>>> video directory.
>>>>>>>>>
>>>>>>>>> However, I can't help but think it might be possible to still
>>>>>>>>> use the
>>>>>>>>> old mythtv data base dump to rename these files to something a
>>>>>>>>> human
>>>>>>>>> can read! (That would be waaaay faster then spot checking them
>>>>>>>>> with
>>>>>>>>> video player!)
>>>>>>>>>
>>>>>>>>> Anyone have ideas on how to do this (i.e. use an old mysql data
>>>>>>>>> base
>>>>>>>>> dump to rename mythtv recordings)?
>>>>>>>>>
>>>>>>>> I'd argue that it would be better, easier, and you'd retain more
>>>>>>>> and
>>>>>>>> better information if you restored the old database, then went
>>>>>>>> through
>>>>>>>> and deleted all the shows whose files are missing.
>>>>>>>>
>>>>>>> But what about shows that have been added into the database since
>>>>>>> the
>>>>>>> old database was backed up?
>>>>>> Don't you have a current database you can just back up?
>>>>> Why yes, but ... I don't remember seeing any mythtv howto's on merging
>>>>> old and new data base dumps.
>>>>>
>>>>> Also, (didn't want to bore you) I have cleaned up the recording
>>>>> rules a
>>>>> fair bit since the old data base dump (seams a lot of people were just
>>>>> pressing "record" in the program listings creating multiple rules
>>>>> for the
>>>>> same shows!).
>>>>>
>>>>> A friend suggested there might be a way to harvest each orphaned
>>>>> recording's information from the old data base and use "INSERT" to
>>>>> place the
>>>>> information into the new data base. It is trivial to create a
>>>>> clean list of
>>>>> orphaned recording files. What I don't know is how to extract from
>>>>> the old
>>>>> dump and insert into the new.
>>>> So the orphans are orphaned files for which someone deleted your
>>>> database
>>>> metadata?
>>>>

Create a new blank database (mythconverg_snafu) and import your old data
into that. You should then be able to use SQL to identify which records
exist in the snafu version, but not the current one. Delete all records
in snafu that exist in the current database, then run something like
mythlink on the snafu database to turn all your orphaned recordings into
human readable file names.

Ian.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.