[mythtv-users] Migrating database from 0.18 to 0.19 (SQL hacking?)

Cory Papenfuss papenfuss at juneau.me.vt.edu
Wed May 3 18:20:01 EDT 2006


 	Somehow I feel like I'm talking to myself... :)

>> 	Ah-ha.... that might work.  Then I can re-export the updated
>> record, recorded, oldrecorded, and recordedmarkup from the 0.19-ified db,
>> flush the DB and reimport.
>>
>> brb... :)
>>
> 	Hrm... close.  After importing the 0.18 DB into a 0.19 system and
> trying to run mythtvsetup, I get the following:
>
> $ mythtvsetup
> 2006-05-03 17:44:46.210 Using runtime prefix = /usr
> 2006-05-03 17:44:46.246 New DB connection, total: 1
> 2006-05-03 17:44:46.258 Connected to database 'mythconverg' at host:
> localhost
> 2006-05-03 17:44:46.261 Total desktop dim: 3200x1200, with 2 screen[s].
> 2006-05-03 17:44:46.278 Using screen 0, 1600x1200 at 0,0
> 2006-05-03 17:44:46.290 Current Schema Version:
> 2006-05-03 17:44:46.291 Newest Schema Version : 1124
> 2006-05-03 17:44:46.293 New DB connection, total: 2
> 2006-05-03 17:44:46.294 Connected to database 'mythconverg' at host: localhost
> 2006-05-03 17:44:46.295 Setting Lock for Database Schema upgrade. If you
> see a long pause here it means the Schema is already locked and is being upgraded by another Myth process.
> 2006-05-03 17:44:46.297 New DB connection, total: 3
> 2006-05-03 17:44:46.298 Connected to database 'mythconverg' at host:
> localhost
> 2006-05-03 17:44:46.301 Told to create a NEW database schema, but the databasealready has 70 tables.
> If you are sure this is a good mythtv database, verify
> that the settings table has the DBSchemaVer variable.
>
> 2006-05-03 17:44:46.302 Database Schema upgrade FAILED, unlocking.
> 2006-05-03 17:44:46.361 Total desktop dim: 3200x1200, with 2 screen[s].
>
> 	Seems like he doesn't want to update himself.  Any thoughts?
>
> -Cory
>

 	Problem solved.  Turns out Knoppmyth calls the hostname 'mythtv' 
and FC5 calls it 'localhost.localdomain'.  The SQL query that mythtvsetup 
did to check the the current DBSchema version included the hostname, so it 
couldn't find it.  Here's the solution (for the archives) on the a 
migration like this:

- Dump 0.18 database from old machine (mysqldump mythconverg > 
backup.sql)
- Create empty mythconverg database on new machine(>create database 
mythconverg; from within mysql)... do NOT make clean database with mc.sql
- Reimport 0.18 db into new machine (mysql mythconverg < backup.sql)
- Run mythtvsetup to update schema
- Dump newly-updated 0.18->0.19 database to new backup (mysqldump 
mythconverg > newbackup.sql)
- Extract out the relevant tables (i.e. 
http://www.mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7)
- Drop database
- Make clean database with (mysql < mc.sql)
- Run mythtvsetup to add new cards, etc.
- Add extractions to new, virgin database (
http://www.mythtv.org/docs/mythtv-HOWTO-23.html#ss23.7)


-Cory

  --

*************************************************************************
* Cory Papenfuss, Ph.D., PPSEL-IA                                       *
* Electrical Engineering                                                *
* Virginia Polytechnic Institute and State University                   *
*************************************************************************



More information about the mythtv-users mailing list