[mythtv-users] Migrate recording schedules and recorded programs to 0.21

Brian Phillips brian.phillips at gmx.net
Sat May 17 22:10:18 UTC 2008


Michael T. Dean wrote:
> I'm soliciting testers and feedback.  They've been well tested (and
> have been tested a /lot/), I just need to get a lot of people to test
> them on a lot of differently-configured systems.  
> 
> http://misc.thirdcontact.com/MythTV/database_mythconverg_backup.pl
> http://misc.thirdcontact.com/MythTV/database_mythconverg_restore.pl
> 
> To backup your DB:
> 
> # echo "DBBackupDirectory=/home/mythtv" > ~/.mythtv/backuprc #
> ./database_mythconverg_backup.pl --verbose 
> 
> Once you get that working, you can run the script (i.e. in cron or
> whatever) without the --verbose switch.
> 
> To restore the DB (assuming you've already specified your
> DBBackupDirectory, as above) using a full restore with the most
> current backup in the DBBackupDirectory:  
> 
> # ./database_mythconverg_restore.pl --verbose
> 
> or, to specify a backup file:
> 
> # ./database_mythconverg_restore.pl --verbose \
>       --filename "mythconverg_1214_20080515221324.sql.gz"
> 
> To do a partial restore (using the most current backup):
> 
> # ./database_mythconverg_restore.pl --verbose --partial_restore
> 
> Again, --verbose is only required if you like to see what it's doing,
> and feel free to specify the backup filename. 
> 
> See, also, the --help output for each script (for far more info than
> you probably want). 
> 

Your link worked like a charm.  The only manual editing I had to do in the
mythtv_restore.sql file before I loaded it back into the database was change
the hostname (as my backend changed hostnames with the switch from mythdora
to mythbuntu).

The perl scripts made the job very slick and I think that you've got a
winner there.  I could tell they've been extensively tested as I found them
to be quite thorough and complete.

One tibit of feedback.  After I dropped the database according to 23.7, I
tried to use database_mythconverg_restore.pl.  It died with an error that
the database didn't exist.  I assume this is to guard against possibly
creating a database with a name that has been fatfingered or something.
Since the restore script pulls the database name from the exact same place
the backup script gets its database name, I think that it would be a safe
option to go ahead and just issue the "create database <dbname>;" if the
database is not found, rather than dropping out with an error.  It wouldn't
make sense to be backing up a database of <dbname> and not be comfortable
restoring those files to the exact same <dbname>.

After I manually issued the "create database mythconverg;" command and
exited mysql, the restore script worked without incident.  Thanks!

Brian Phillips



More information about the mythtv-users mailing list