[mythtv-users] Dumping database and starting over?
cythrault at gmail.com
cythrault at gmail.com
Mon Mar 28 14:56:56 UTC 2005
Hi,
Simply import back your recorded table. To my knowledge, it's all you need.
I imagine your backup was something like a mysqldump. If so simply run this:
cat [your backup file] | grep "INSERT INTO recorded " | mysql -u
mythtv -p mythconverg
You backup may be compressed with bzip2 or bzip:
bzip:
zcat [your backup file] | grep "INSERT INTO recorded " | mysql -u
mythtv -p mythconverg
bzip2:
bzip2 -dc [your backup file] | grep "INSERT INTO recorded " | mysql -u
mythtv -p mythconverg
You can break the process into two phases in order to inspect the results:
1. cat [your backup file] | grep "INSERT INTO recorded " > recorded.sql
2. [inspect recorded.sql]
3. cat recorded.sql | mysql -u mythtv -p mythconverg
I take the opportunity to point out a good way to implement a backup
schedule for your DB. I use the following script in a daily cron job:
#!/bin/sh
dbdump="/myth/backup/mythtv_backup.`date '+%w'`.sql.bz2"
nice --19 /usr/bin/mysqldump -u mythtv -pmythtv mythconverg -c | bzip2
-c > ${dbdump}
The script also contains this which backup my /myth to a remote
machine. The destination could also be another path or volume on the
same host.
for i in video recs vids mp3 pics posters
do
echo "-- $i"
/usr/bin/rsync --progress -ru --delete /myth/$i/
root at teevee2.elitemag.org:/myth/$i
echo "--"
done
Good day,
cyth
On Mon, 28 Mar 2005 06:11:06 -0700, Chad <masterclc at gmail.com> wrote:
> Thank you! I decided to just drop the db, after doing a backup first,
> and then toy with it later to see if I can recover the existing
> programs via something like you have explained above, figure it was a
> quick way to get back on my feet, and I can play around with it later.
>
> Thanks again!
>
> On Mon, 28 Mar 2005 14:25:02 +0200, Rickard Olsson
> <richie at webhackande.se> wrote:
> > Chad wrote:
> >
> > > I'm having problems with my database right now, and am considering
> > > just dumping to an sql and starting over. I'm wondering how
> > > successful I'll be if I try to dump the sql back to mysql and see my
> > > programs again. Obviously I won't delete the files themselves, but
> > > I'm wondering if the db will see them afterwards? What if I don't
> > > dump it back to mysql?
> >
> > I did a variant of this last night. Your options are to export the files
> > with nuvexport (option 10 - export to nuv and sql) or use another
> > program (I used Webmins MySQL module) to export the relevant tables
> > (programming info seems to be in the recorded, oldrecorded and
> > recordedmarkup tables).
> >
> > Then, you simply import the tables using whatever tool you used to
> > export them (well, expect nuvexport).
> >
> > If you do not backup the tables, myth will not see the files. All the
> > episode data is in the database. It is possible to use the
> > mythrebuild.pl script (it's in the contrib folder of the mythtv
> > distribution) to create new database entries for the files, but then
> > you'll have to enter all the info by hand. Backup the database already. :-)
> >
> > In my case, I saved the channels and card tables and re-generated the
> > rest from scratch and then re-imported the saved channels. This fixed my
> > problem with not being able to list recorded shows in mythfrontend and
> > mythweb. YMMV.
> >
> > Depending on your specific database problems, you may also want to look
> > at the various ways to repair broken mysql databases:
> >
> > http://www.databasejournal.com/features/mysql/article.php/3300511
> >
> > / Rickard Olsson,IT-Konsult/
> > / Telefon: +46 70 635 01 42/
> > / http://www.webhackande.se/
> >
> >
> > _______________________________________________
> > mythtv-users mailing list
> > mythtv-users at mythtv.org
> > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> >
> >
> >
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
More information about the mythtv-users
mailing list