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

upgrading from r5d1 to 6.01 - db contents disappear
http://forums.linhes.org/viewtopic.php?f=22&t=20526
Page 1 of 1

Author:  backinblack [ Sun Nov 15, 2009 7:57 pm ]
Post subject:  upgrading from r5d1 to 6.01 - db contents disappear

hi all,

i'm trying to upgrade directly from a vanilla r5d1 installation to 6.01. i have set up a test box by copying my installation by rsync'ing root and /myth. i can bring up r5d1 on the copy and it all looks normal so i know it's copied everything. when i run the 6.01 upgrade it all runs through without errors. however after it reboots i find that the db seems to be empty - no program guide, no recordings, no recording rules.

my questions are :

1.

should the upgrade to 6.01 preserve the contents of the db ?

2.

assuming it should keep the db contents :

a.

what upgrade logs can i check to see what has happened that might explain why this did not occur as expected ?

b.

is there something in particular i have to do to make sure it picks up my old db ?

c.

is there a script i can run ( that the upgrade would / should use ) to copy / load my existing db into the new empty db. i presume there are some schema changes between myth 0.19 ( r5d1 ) and 0.21 ( 6.01 ) so that i can't just use the old db.

3.

if i have to, can i just load all the old columns from all my old tables into the new empty db ? if so, is there a mysql command that will generate inserts using column names ?

regards.

Author:  tjc [ Mon Nov 16, 2009 10:07 pm ]
Post subject:  Re: upgrading from r5d1 to 6.01 - db contents disappear

backinblack wrote:
1. should the upgrade to 6.01 preserve the contents of the db?

Yes.

backinblack wrote:
2. assuming it should keep the db contents :
a. what upgrade logs can i check to see what has happened that might explain why this did not occur as expected?

The upgrade process actually tells you this itself.

backinblack wrote:
b. is there something in particular i have to do to make sure it picks up my old db?

See my notes here: http://knoppmyth.net/phpBB2/viewtopic.php?t=20302

backinblack wrote:
c. is there a script i can run ( that the upgrade would / should use ) to copy / load my existing db into the new empty db. i presume there are some schema changes between myth 0.19 ( r5d1 ) and 0.21 ( 6.01 ) so that i can't just use the old db.

You can try doing a DB restore using the standard scripts. The BE/FE should then automatically upgrade the schema to the current revision. This may mean that some new settings revert to MythTV (versus KM or LH) defaults.

Author:  stonewalker [ Tue Nov 17, 2009 6:54 pm ]
Post subject: 

I have a similar problem. (no DB after upgrade...)
Should we continue here, or is 'good style' to start a new thread for every problem?

Author:  backinblack [ Wed Nov 18, 2009 10:34 pm ]
Post subject:  Re: upgrading from r5d1 to 6.01 - db contents disappear

based on :

Quote:
You can try doing a DB restore using the standard scripts. The BE/FE should then automatically upgrade the schema to the current revision.


what i've now done is :

a.

clean install of linhes 6.01 making sure i use the same host name

b.

after installation, exit straight out of myth-setup and run mythrestore. however, mythrestore fails creating the first table in the dump because it already exists. i suspect that this is what happened when i first tried to run the upgrade. my resolution was to edit mtyhrestore to drop the database immediately before it runs the create database command. since the create database command is already there in mythrestore, i'm hoping that there really shouldn't be a problem dropping the db at this point. the restore then worked successfully.

c.

when mytbackend starts after the restore, i can see from the mythbackend log that it's upgrading the schema automatically. after the schema is up to date mythbackend is available and all my data seems to be there :)





why did my r5d1 dump fail to restore into an already populated database when it tried to create a table that already existed?

after i finished my installation and restore i ran mythbackup. looking at the sql generated i can see that it now includes a 'drop table if exists' before every 'create table' statement. so if you're upgrading from a more up to date version of myth ( that includes the drop statements ) then the upgrade ( or at least mythrestore ) will probably work smoothly.





so it's all looking good. my only concern is if there are any issues with me actually droppping the database before restoring ? e.g. is there anything in the 'mysql' database ( as opposed to 'mythconverg' ) that i need to recreate ? i'll do a dump of the mysql db before and after i drop the mythconverg db next time i run this test and see if that shows any differences.



thanx again for all the help so far.

Author:  tjc [ Fri Nov 20, 2009 8:45 pm ]
Post subject: 

Well, it used to drop the old tables before restoring. There are several reasons for doing this some having to do with how MythTV does automatic schema updates based on the versions restored into the db.

If it's not doing that anymore someone else must have changed it. I'd have to check the git repository to figure out who and what they were thinking.

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