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

Tom Lichti tom at redpepperracing.com
Wed May 3 17:02:50 EDT 2006


Cory Papenfuss wrote:
>  	Hey all... finally getting around to updating my mythbox to a 
> newer version.  Trouble is, the usual procedure:
>
> $ grep "INSERT INTO record "         mythtv_backup.sql > restore.sql
> $ grep "INSERT INTO recorded "       mythtv_backup.sql >> restore.sql
> $ grep "INSERT INTO oldrecorded "    mythtv_backup.sql >> restore.sql
> $ grep "INSERT INTO recordedmarkup " mythtv_backup.sql >> restore.sql
> $ mysql -u mythtv -pmythtv mythconverg < restore.sql
>
> doesn't work anymore.  I've read the archives and noticed how the 
> mysqldump now back-ticks the 'recorded' etc so these lines are necessary:
>
>      $ grep "INSERT INTO \`record\` "         mythtv_backup.sql > restore.sql
>      $ grep "INSERT INTO \`recorded\` "       mythtv_backup.sql >> restore.sql
>      $ grep "INSERT INTO \`oldrecorded\` "    mythtv_backup.sql >> restore.sql
>      $ grep "INSERT INTO \`recordedmarkup\` " mythtv_backup.sql >> restore.sql
>
>  	Trouble is, this part:
> $ mysql -u mythtv -pmythtv mythconverg < restore.sql
>
>  	now barfs with:
> ERROR 1136 (21S01) at line 1: Column count doesn't match value count at row 1
>
>  	After reading:
> http://www.gossamer-threads.com/lists/mythtv/users/141303?search_string=grep%20INSERT%20;#141303
>
>  	it appears that there's a new field in there.  What's the method 
> for adding it in?  I'm not excited about hacking up 233706 lines in my 
> 3-year old database.  Hopefully there's a good way...
>
>
> -Cory
>   
You don't want to just let Myth upgrade the db schema for you? You would 
probably have better results with that than trying to hack it manually. 
Having said that, my system has always run close to current SVN, so I've 
just picked up all the updates along the way, but I haven't heard of any 
problems with letting Myth do it.

Tom


More information about the mythtv-users mailing list