View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 16 posts ] 
Go to page 1, 2  Next

Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Mar 07, 2010 7:10 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
See this thread for details. Kudos to Mike on the mythtv mailing list and to RacerX in here for pointing me to Mike's post.

Read them both at that thread. Here are the broad steps to get broken databases working:

1) Update your system to 0.22 using cesman's script for by manually doing it based on his script but DO NOT let the 0.22 backend start before you backup your database!

Note the below is distilled from the upgrade script and is specific to my system. I recommend that you do not blindly follow it, rather, follow the script itself!

Code:
sv stop mythbackend
pacman -Sy
pacman -R mythvodka
cp /usr/share/mythtv/is.xml /usr/share/mythtv/is.xml.021
pacman -R mythcontrols mythsmolt
pacman -S kernel26
pacman -Su
<<<takes quite a while depending on connection speed>>>
<<<May have to manually delete some directories to avoid failures>>>
cp /usr/share/mythtv/is.xml.021 /usr/share/mythtv/is.xml



2) Stop the backend (# sv stop mythbackend)

3) Backup the functional 0.21-fixes database:

As mythtv
Code:
echo "DBBackupDirectory=/home/mythtv" > ~/.mythtv/backuprc
mythconverg_backup.pl --verbose


4) DROP your old database:
Code:
cat << "EOF" | mysql -umythtv -p mythconverg
DROP DATABASE IF EXISTS mythconverg;
CREATE DATABASE IF NOT EXISTS mythconverg;
ALTER DATABASE mythconverg DEFAULT CHARACTER SET latin1;
EOF


The password is just mythtv.

5) Download the blank 0.21 database from that thread or from my server via a wget http://www.techarp.com/graysky/mythconv ... ank.sql.gz

Now do a complete restore of the blank one:

Code:
mythconverg_restore.pl --dir=$HOME --file=mythconverg-1214-blank.sql.gz --verbose


6) NOw do a partial restore of your database on top of the blank one

Code:
mythconverg_restore.pl --dir=$HOME --file=mythconverg-1214-20100307080417.sql.gz --partial_restore --verbose


You'll need to adjust the file name of the backup to match YOUR backup!

7) Remove the backuprc
Code:
 rm ~/.mythtv/backuprc


That should do it. Now run mythtv-setup and reconfigure EVERYTHING (sorry this is a side effect), restart the backend when you're finished, and run mythfilldatabase. NOW you should be okay and running 0.22.

I ran into several problems:

1) I couldn't get the line in cesman's upgrade_to_0.22.sh that fixes the custom schema to work:

Code:
# /usr/LH/bin/update_schema_021_to_022.sh
ERROR 1146 (42S02) at line 1: Table 'mythconverg.gameplayers' doesn't exist


2) I have no more options to shutdown or restart from the menu (hit the M key to get the menu popup). Flyspray: http://linhes.org/flyspray/index.php?do ... ask_id=638

3) I can't setup a mythweb password. Flyspray: http://linhes.org/flyspray/index.php?do ... ask_id=639

4) Mythvideo playback freezes up unless I use the internal player (mplayer doesn't work at all even though I have specified it in the configs).

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Last edited by graysky on Fri May 28, 2010 4:53 pm, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 12, 2010 8:53 pm 
Offline
Site Admin
Joined: Fri Sep 19, 2003 6:37 pm
Posts: 2659
Location: Whittier, Ca
:? This doesn't make sense... In KnoppMyth and LinHES, out the box you should have no issues w/ the db unless you've made modification on your own or perhaps did a restore from something else. Out the box, we included settings so you don't have to configure certain settings yourself.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 13, 2010 5:23 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
cecil wrote:
:? This doesn't make sense... In KnoppMyth and LinHES, out the box you should have no issues w/ the db unless you've made modification on your own or perhaps did a restore from something else. Out the box, we included settings so you don't have to configure certain settings yourself.


Dunno what to say - it's my original db from R4 which I haven't modified. @cesman, is there a chance you can provide me with a blank version 214 db like I posted about, except one that contains the LinHES extras (to my point #1).

Although I actually posted the howto, I downgraded my box back to R6.01.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 13, 2010 10:39 am 
Offline
Joined: Wed Jan 04, 2006 10:20 am
Posts: 387
Location: South New Jersey, USA
I can second Grayskys experiance as my did the same. I followed his how to and it upgraded after opening mythtv-setup and seems to be working fine since them.
Unfortunelty since the setup scripts never finished, I have been fighting demons (and daemons) every since.

_________________
LINHES 8.6.1 BE/FE - MSI K9N6SGM-V with AMD A64 X2 4600+, 4GB Ram. 1.5TB WD. HDHR Prime. Nvidia GT210. MCE remote.
FrontEnd - Dell Vostro 400 3.0GHz Core2Duo NVidia GeForce210. MCE Remote


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 13, 2010 1:41 pm 
Offline
Site Admin
Joined: Fri Sep 19, 2003 6:37 pm
Posts: 2659
Location: Whittier, Ca
graysky wrote:
blank version 214 db like I posted about, except one that contains the LinHES extras (to my point #1).
What ia a 214 db?!

I have an idea on how to restore without going thru much db hassles (hopefully). I'll have to play with it and see what happens.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 14, 2010 5:47 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
cecil wrote:
graysky wrote:
blank version 214 db like I posted about, except one that contains the LinHES extras (to my point #1).
What ia a 214 db?!

I have an idea on how to restore without going thru much db hassles (hopefully). I'll have to play with it and see what happens.


See this post. The author made a blank version 214 database (which is what I was referring to in my request.), but again, his db doesn't work with the LH specific schema that your script tries to add.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2010 2:58 pm 
Offline
Joined: Tue Mar 29, 2005 8:19 am
Posts: 67
Location: Torino, ITALY
cecil wrote:
I have an idea on how to restore without going thru much db hassles (hopefully). I'll have to play with it and see what happens.


I'm in the same situation (I think it happend trying to restore a R6.01 backup to a R6.02 installation). I'm now stuck R6.01 with a barely working 4 years old DB with 400gb in recordings so if you happen to have any idea I would be eternally grateful...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2010 5:37 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
cecil wrote:
I have an idea on how to restore without going thru much db hassles (hopefully). I'll have to play with it and see what happens.


This would be welcomed. I would like to upgrade to 6.02, but I don't wanna lose my database (been collecting data since 2003). Please let us know.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 24, 2010 1:47 pm 
Offline
Joined: Wed Jan 04, 2006 10:20 am
Posts: 387
Location: South New Jersey, USA
@graysky, Did the solution that you posted not work for you. As I mentioned earlier, it gave me goofy results when I went right back to the backend but running mythtv-setup allowed it to upgrade the 214 DB without a problem. I would think that it would work for benotto also.

_________________
LINHES 8.6.1 BE/FE - MSI K9N6SGM-V with AMD A64 X2 4600+, 4GB Ram. 1.5TB WD. HDHR Prime. Nvidia GT210. MCE remote.
FrontEnd - Dell Vostro 400 3.0GHz Core2Duo NVidia GeForce210. MCE Remote


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 24, 2010 4:22 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
@bbs - it worked, but I wasn't able to apply cesman's LH specific schema. Also, I had problems with my mythweb password not working. I downgraded as a result (still running R6.01 which is mythtv-0.21-fixes).

Hopefully cesman's idea he posted about will work.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 26, 2010 6:41 am 
Offline
Joined: Wed Jan 04, 2006 10:20 am
Posts: 387
Location: South New Jersey, USA
Hmmm. I didnt realize that this fix would result in me having a Non-Linhes schema. Is that true and does anyone know if I will wind up with more DB problems in the next Linhes upgrades?

I also had a problem with mythweb password but was able to get it going manually by editing the lighttpd security file per this post
http://knoppmyth.net/phpBB2/viewtopic.php?t=20844&highlight=lighttpd+password

I have found a lot of things in 6.02 that dont implement as easily as I thought they would. I have been able to get everything working that I wanted but it was not as easy as selecting a box in the Linhes menu as I had hoped. I am not sure if that is just the nature of the beast (for this version) or if this is a result of install script bombing out.
In any case, if you are motivated, I suggest doing the schema update and upgrading.

_________________
LINHES 8.6.1 BE/FE - MSI K9N6SGM-V with AMD A64 X2 4600+, 4GB Ram. 1.5TB WD. HDHR Prime. Nvidia GT210. MCE remote.
FrontEnd - Dell Vostro 400 3.0GHz Core2Duo NVidia GeForce210. MCE Remote


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 18, 2010 10:48 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
cecil wrote:
graysky wrote:
blank version 214 db like I posted about, except one that contains the LinHES extras (to my point #1).
What ia a 214 db?!

I have an idea on how to restore without going thru much db hassles (hopefully). I'll have to play with it and see what happens.


Any luck w/ this, cesman?

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2010 6:31 pm 
Offline
Joined: Thu Feb 01, 2007 9:06 pm
Posts: 4
I just upgraded from R5.5 to R6.02 yesterday and had a similar problem. I didn't want to rebuild the entire database, so I found a different method.

After much googling, I found the code the drives the schema upgrade is dbcheck.cpp. You can search the code for your current schema version and then manually apply the SQL from the code.

For example, I had problems with the 1230->1231 upgrade. Below is the code from dbcheck.cpp and how I converted that into SQL.

Code:
    if (dbver == "1230")
   {
       const char *updates[] = {
// Content identfiers are authority (32) + data (29) + instance (3) = 64
"ALTER TABLE program"
"  MODIFY programid varchar(64) CHARACTER SET utf8 NOT NULL default '',"
"  MODIFY seriesid varchar(64) CHARACTER SET utf8 NOT NULL default '';",
// tidy up content identifiers without authorities
"UPDATE program SET programid = '' WHERE programid like '/%';",
"UPDATE program SET seriesid = '' WHERE seriesid like '/%';",
// Add network level default authorities to the multiplex tables
"ALTER TABLE dtv_multiplex ADD COLUMN"
"    default_authority varchar(32) CHARACTER SET utf8 NOT NULL default '';",
"ALTER TABLE channelscan_dtv_multiplex ADD COLUMN"
"    default_authority varchar(32) CHARACTER SET utf8 NOT NULL default '';",


Code:
ALTER TABLE program MODIFY programid varchar(64) CHARACTER SET utf8 NOT NULL default '', MODIFY seriesid varchar(64) CHARACTER SET utf8 NOT NULL default '';
UPDATE program SET programid = '' WHERE programid like '/%';
UPDATE program SET seriesid = '' WHERE seriesid like '/%';
ALTER TABLE dtv_multiplex ADD COLUMN default_authority varchar(32) CHARACTER SET utf8 NOT NULL default '';
ALTER TABLE channelscan_dtv_multiplex ADD COLUMN default_authority varchar(32) CHARACTER SET utf8 NOT NULL default '';
UPDATE settings SET DATA = '1231' WHERE VALUE = 'DBSchemaVer';
COMMIT;


I suspect there are a few possible reasons for this problem:
1. Bug in dbcheck.cpp version used by this build of mythtv
2. Corrupt version of dbcheck.cpp used by this build of mythtv
3. Multiple programs that run dbcheck.cpp running simultaneously, such as mythtv-setup and mythbackend
4. 6.02 possibly re-encoding the DB from latin1 to UTF-8 before finishing the schema upgrades

Hopefully this helps others.

On a related note, 6.02 seems like a great release. Other than this one issue, the upgrade was relatively seamless.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2010 2:53 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
@mperlman - can you provide a few more details? Most of us including myself is not SQL savvy at all :)

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2010 5:55 pm 
Offline
Joined: Thu Feb 01, 2007 9:06 pm
Posts: 4
Sorry about that. I just reread my post and I'm not sure how I expected anyone to understand it. ;)

dbcheck.cpp seems to be the source code for a library shared by both mythtv-setup and mythbackend. Every time either of these programs run, they check the DB schema version to ensure it's the expected version. If not, they run through the schema upgrade process found in this code.

Before starting a manual schema upgrade, you should definitely kill any running mythtv-setup processes and run

Code:
sv stop mythbackend


to ensure the backend is not running.

In my instance, the schema version was 1230 and MythTV expected version 1244, so it started going through the upgrade process schema version by schema version (i.e., 1230->1231->1232->...->1244).

The full C++ code (including line numbers) for the 1230->1231 upgrade is

Code:
4610       if (dbver == "1230")
4611       {
4612           const char *updates[] = {
4613   // Content identfiers are authority (32) + data (29) + instance (3) = 64
4614   "ALTER TABLE program"
4615   "  MODIFY programid varchar(64) CHARACTER SET utf8 NOT NULL default '',"
4616   "  MODIFY seriesid varchar(64) CHARACTER SET utf8 NOT NULL default '';",
4617   // tidy up content identifiers without authorities
4618   "UPDATE program SET programid = '' WHERE programid like '/%';",
4619   "UPDATE program SET seriesid = '' WHERE seriesid like '/%';",
4620   // Add network level default authorities to the multiplex tables
4621   "ALTER TABLE dtv_multiplex ADD COLUMN"
4622   "    default_authority varchar(32) CHARACTER SET utf8 NOT NULL default '';",
4623   "ALTER TABLE channelscan_dtv_multiplex ADD COLUMN"
4624   "    default_authority varchar(32) CHARACTER SET utf8 NOT NULL default '';",
4625   NULL
4626   };
4627           if (!performActualUpdate(updates, "1231", dbver))
4628               return false;
4629       }


Taking this line-by-line (sorta),
4610 checks to confirm that the DB version is 1230
4611-4612 are (superfluous) C++ code structure and can be ignored
4614-4616 are the first SQL statement, but embedded in C++ quotes.

Code:
"ALTER TABLE program"
"  MODIFY programid varchar(64) CHARACTER SET utf8 NOT NULL default '',"
"  MODIFY seriesid varchar(64) CHARACTER SET utf8 NOT NULL default '';",


Stripping out all the C++ excess and eliminating newlines, etc, you get:

Code:
ALTER TABLE program MODIFY programid varchar(64) CHARACTER SET utf8 NOT NULL default '', MODIFY seriesid varchar(64) CHARACTER SET utf8 NOT NULL default '';


Essentially, this statement does something pretty similar to what it says. Namely, it modifies the columns programid and seriesid of table program to have a different structure. (I have no idea why the MythTV developers want to do this.) This statement can be run directly in the database at the mysql> prompt.

4618, 4619, 4621-4622 and 4623-4624 are the rest of the embedded SQL statements and can be extracted in a similar fashion to the above statement.

Line 4627 definitely required some interpretation.

Code:
if (!performActualUpdate(updates, "1231", dbver))


Reading through the C++ code, it seems like this essentially updates the schema version stored in the settings table. There are multiple ways to turn this into SQL, but the most direct seemed to be an update statement.

Code:
UPDATE settings SET DATA = '1231' WHERE VALUE = 'DBSchemaVer';


After making all the schema changes, all the changes are made permanent in the database by running

Code:
COMMIT;


Once you commit the changes, you can (and probably should) let MythTV take over the upgrade process again (until it hits the next error ;)). In my case that was as simple as running

Code:
sv start mythbackend


and watching /var/log/mythtv/mythbackend.log for any more errors.

For most of the schema updates in dbcheck.cpp, this logic can be applied in a pretty straightforward (albeit manual) way to "force" the schema upgrade to the next version.

Hopefully this is a more helpful explanation. Please let me know if there are any areas that require further clarification or explanation.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ] 
Go to page 1, 2  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu