LinHES Forums
http://forums.linhes.org/

MySQL export to text
http://forums.linhes.org/viewtopic.php?f=17&t=15993
Page 1 of 1

Author:  flatchmo [ Sun Jul 29, 2007 12:24 pm ]
Post subject:  MySQL export to text

My database is hosed. I have run all the standard fix utilities.
I think I am going to wipe and reload with the latest version.
I would like to keep a few of the tables, but I don't know the name of the tables.

The only table I would like to keep is the "already viewed programs"
Every time I wipe and reload it takes months to teach MYTHBOX that I have already viewed this particular episode of the simpsons, Mythbusters, etc
I see that these tables are the most likely suspects.
recorded
recorded program

What is the way to export to text file?
Then import after rebuild?

TIA

Author:  manicmike [ Sun Jul 29, 2007 2:31 pm ]
Post subject:  Re: MySQL export to text

flatchmo wrote:
My database is hosed. I have run all the standard fix utilities.
I think I am going to wipe and reload with the latest version.
I would like to keep a few of the tables, but I don't know the name of the tables.

The only table I would like to keep is the "already viewed programs"
Every time I wipe and reload it takes months to teach MYTHBOX that I have already viewed this particular episode of the simpsons, Mythbusters, etc
I see that these tables are the most likely suspects.
recorded
recorded program

What is the way to export to text file?
Then import after rebuild?

TIA


Best way is to go to "Knoppmyth" menu and make a backup. This will back up your database and everything in /etc and /home. Copy this elsewhere for later use. This is what's used for auto upgrades.

Alternatively, "mysqldump -u root mythconverg > 20070730-mythconverg.sql" will just back up the database. You may also want to pipe it through gzip. You can also save individual tables by putting their names after the db name, like "mysqldump -u root mythconverg program channel video".

Mike

Author:  babblefish [ Mon Jul 30, 2007 2:05 pm ]
Post subject: 

I think you will be interested in keeping the following tables. These tables have details of old and current recordings.

oldrecorded
people
record
recorded
recordedcredits
recordedmarkup
recordedprogram
recordedrating
recordedseek


There is a pitfall. The tables are linked by the chanid field and if the new install chose a different chanid value for each channel then it might not work too well. Any rules for instance associated with a particular channel will either not work or will be attached to a different channel. I have been in a similar situation and ended up having to go through a fairly convoluted process to get the old imported records in the tables associated with the correct channels.

Babblefish

Author:  Dthom [ Sat Aug 04, 2007 9:30 am ]
Post subject: 

To get a text file:

mysqldump mythconverg > mythconverg.sql

make sure you add:

add-drop-table

to the [mysqldump] section in /etc/mysql/my.cnf

This dumps the DB to a text file. You can then edit manually (if you want), and rebuild with:

mysql mythconverg < mythconverg.sql

Author:  tjc [ Sat Aug 04, 2007 10:49 am ]
Post subject: 

The standard backup actually does a dump to text format. How well that will work _by any means_ when the DB is hosed is an open question.

Author:  spalVl [ Sat Aug 04, 2007 1:11 pm ]
Post subject: 

Here is a howto

http://www.mythpvr.com/mythtv/tips/migr ... dings.html

Keep in mind the channel ids and hostname either must kept the same or SQL files changed prior to import.

Author:  flatchmo [ Thu Aug 23, 2007 10:00 pm ]
Post subject: 

Thanks Y'all

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/