MD 5 install, restoring a MD4 database

I have to reinstall my system. I had a working MD4 box, but the MB died. Got a new board, and put the old drive in it, and it refuses to boot. LVM error. See here (http://mythdora.com/?q=node/3412) if interested.

Anyway, I can access the LVM's on the old drive via a knoppix boot cd. I have copied off all my videos, and recordings. I have also copied off the daily DB backups that were done. THANK YOU FOR DOING THIS BY DEFAULT!!! :)

So long story short, I have to use the old data drive for the new install. I don't have any other sata drives laying around.

How can I install on the new system and get all my old data back. From reading up, I can do the new install, copy my recorded shows over to /storage/recordings, drop the mythconverge database, recreate it from the backup(a backup was done a less then 24 hours before the crash, lucky me), then restart myth. From what I read, myth will upgrade the DB to the new schema if needed correct?

I am just trying to find a way to do this as painless as possible. And it gives me a good reason to go to MD5. Any help would be appreciated.

this thread saved my sanity

I've been using a separate master/slave installation of MythDora 4.0 for over a year.

Suddenly, one of the LVM disks died and I lost mysql database was corrupted, but the database backup was still in tact, so I used the instructions in this thread to successfully restore all of my scheduling preferences and it work perfectly.

THANK YOU SO MUCH for automatically setting those backups as a default.

You guys rock.

Quote:

Quote:

How can I install on the new system and get all my old data back. From reading up, I can do the new install, copy my recorded shows over to /storage/recordings, drop the mythconverge database, recreate it from the backup(a backup was done a less then 24 hours before the crash, lucky me), then restart myth. From what I read, myth will upgrade the DB to the new schema if needed correct?

That is exactly correct. Many have done this without issue. Actually I think this is a better method then trying to do an upgrade. An upgrade still leaves behind FC6 rpm's and your video drivers "may" get fracked. It's just better to start fresh IMHO. Be sure to upgrade to the latest mythtv packages after your install. This will fix some issues that we had in MythDora as well.

"Please ignore the man behind the curtain"
Dennis

"Please ignore the man behind the curtain"
Dennis

Restoring MD4 database and recordings

I have the same problems after one of two HDs in my LVM started misbehaving and then died. I have a database and my recordings on a USB HD, so to restore these in MD5 I should:

1. Install MD5.

2. Drop the MD5 database. Does this mean I need to log in as root or su in a terminal and delete it entirely?

3. Copy MD$ database backup into /storage/dorabackup

4. Copy all old recordings into /storage/recordings

4. Start MythTV from the desktop, then Mythdora Tools - Database Tools - Database Backup - Restore DB

5. Exit MythTV and restart the computer

I apologise for being slow on the uptake!

Cheers

Nick

Believe you've got it

Believe you've got it ;-)

Answer to question 2.

$ mysql -uroot
mysql > drop database mythconverg;
mysql > quit
$ mysql -uroot < /path/to/saved/mythdora4backup.sql

You can just import the DB from command line if you've copied the DB over OR you can use the Restore DB feature, your choice.

"Please ignore the man behind the curtain"
Dennis

"Please ignore the man behind the curtain"
Dennis

No UPnP database found

When I start Mythtv up after my restart, no matter what I do, it can't find my backend.
I wonder if I should have written my old MYSQL database password down...
Cheers
Nick

Upgrade MD4 to MD5 in 2hrs.

middlewordie wrote:

When I start Mythtv up after my restart, no matter what I do, it can't find my backend.
I wonder if I should have written my old MYSQL database password down...
Cheers
Nick

Ok, following a reinstall, I now have my old database back and am watching the 240GB of recordings copy across. I will be watching for another 2hrs or so!

The process I've used is as follows and it assumes:

A) The backup from the MD4 database mythconverg.sql is stored in /media/disk/storage/dorabackup
Remember you have to extract the database from the gz file before your start!

B) The recordings are in /media/disk/storage/recordings.

PROCESS

1. Install MD5.

2. Start MythTV Setup

3. Select all the defaults for the 1. General section

4. Create new directory in 6. Storage Directory for Default. This should be

/storage/recordings

5. Open up a Terminal and type the following lines.

$ mysql -uroot
mysql > drop database mythconverg;
mysql > create database mythconverg;
mysql > quit
$ mysql -uroot mythconverg.sql < /media/disk/storage/dorabackup/mythconverg.sql
$ exit

6. Open MythTV Setup. It will ask you if you want to Upgrade. You do so select Upgrade.

7. Make yourself a cup of tea - it may take a few minutes for the database to be upgraded, and neither MythTV or MythTV Setup responds to being started until this has finished.

8. Open MythTV Setup and go through all the options - hopefully it will have quite a lot already filled in from your previous MD4 system!

9. Open up MythTV and go to Media Library, Watch Recordings - hopefully everything you recorded in MD4 is now listed, if not physically on the system yet!

10. Copy the contetns of your MD4 recordings (/media/disk/recordings) into the MD5 recordings folder (/storage/recordings). This may take a few hours if you have a lot of stuff recorded.

This worked for me and hopefully it helps someone else.

Cheers

Nick

Except for a minor change in

Except for a minor change in Step 5, this worked perfectly for me in upgrading from MD3.2 to MD5.

Instead of "create database" in step 5, I had to use

$ mysql -uroot </usr/share/doc/mythtv-docs-0.21/database/mc.sql

to get the database created.

I also used the mythconverg_restore.pl script from http://www.mythtv.org/wiki/index.php/Database_Backup_and_Restore since I had used the backup command from that to make my backup.

Thereafter everything worked perfectly, and I was able to carry on with Myth as if nothing happened (I left my recordings, on a separate hdd, where they were, so it was just a matter of installing a new version and restoring the database.

Thanks

d00dtv wrote:

That is exactly correct. Many have done this without issue. Actually I think this is a better method then trying to do an upgrade. An upgrade still leaves behind FC6 rpm's and your video drivers "may" get fracked. It's just better to start fresh IMHO. Be sure to upgrade to the latest mythtv packages after your install. This will fix some issues that we had in MythDora as well.

Ok. When installing mythdora, it launches the mythtvsetup. Should I cancel out of that, then get the new packages and relaunch mythtvsetup?

My first myth install was by hand, the 2nd was mythdora 4. So I am a tad rusty on the way things work with upgrading myth. Honestly never done it. Ran .17 for forever then went to .20. Now it looks like .21. :)

I would at least go through

I would at least go through the first General option in mythtvsetup then grab your new rpm's. Then drop the new 0.21 DB and import your old DB, then rerun mythtvsetup and delete your card settings. Redo all of mythtvsetup after that.

"Please ignore the man behind the curtain"
Dennis

"Please ignore the man behind the curtain"
Dennis

So what is the command to

So what is the command to import you old DB?

I tried to restore from a backup, then I restarted the both mysql and mythbackend and it asks to upgrade the DB and I select upgrade and it flashes back to the desktop, mythtv won't even start and mythsetup just keeps asking to upgrade the DB. I looked in the /storage/recording files and there are several mythconverg-dates-.sql.gz files. Same thing after PC restart.

So I am assuming that I need to import or merge the DB somehow????

Regards,

Mike Bennett
www.mbrocketry.com

Regards,

Mike Bennett
www.mbppg.com

question...

d00dtv wrote:

I would at least go through the first General option in mythtvsetup then grab your new rpm's. Then drop the new 0.21 DB and import your old DB, then rerun mythtvsetup and delete your card settings. Redo all of mythtvsetup after that.

"Please ignore the man behind the curtain"
Dennis

Thanks for the help, this worked great as well. 2 questions though. When I do the mythtvsetup what user do I run it as??

I also got an error when updating the db schema. At 1203, it gave me an error about the upnpmedia table already existing. I went into the db, dropped that empty table, and relaunched mythtv setup. Worked great after that. Could this be related to who I ran mythtvsetup as?? Thanks

Simply enter into the mythtv

Simply enter into the mythtv setup provided in MythDora Tools or use the shortcut on the desktop. No need to use a command prompt. On the DB error, that is normal. You will see this even on a fresh install but no need to drop any tables. It will update itself.

"Please ignore the man behind the curtain"
Dennis

"Please ignore the man behind the curtain"
Dennis

How to restore the DB?

I'm having similar problems. I have a DB from MD4, when I upgraded the DB per setup's request, it flopped. Now I can't open the backend, the frontend, or the setup. (well setup opens, but flops) So I'm stuck with a command line restore. Preferable a restore for the original would be nice.

That was the problem.

That was the problem. Everytime I tried to run the mythtvsetup it would bomb out on that table at 1203.

Once I removed it, it completed.

I think I am having the same

I think I am having the same problem on a new laptop frontend only install.


[root@localhost mythtv]# mythtvsetup
Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
2008-09-06 00:19:06.968 Using runtime prefix = /usr, libdir = /usr/lib
2008-09-06 00:19:06.975 DPMS is disabled.
2008-09-06 00:19:06.975 Unable to read configuration file mysql.txt
2008-09-06 00:19:06.976 Empty LocalHostName.
2008-09-06 00:19:06.976 Using localhost value of localhost.localdomain
2008-09-06 00:19:06.985 New DB connection, total: 1
2008-09-06 00:19:07.014 Connected to database 'mythconverg' at host: localhost
2008-09-06 00:19:07.015 Closing DB connection named 'DBManager0'
2008-09-06 00:19:07.017 Primary screen 0.
2008-09-06 00:19:07.018 Connected to database 'mythconverg' at host: localhost
2008-09-06 00:19:07.019 Using screen 0, 1280x800 at 0,0
2008-09-06 00:19:07.025 New DB connection, total: 2
2008-09-06 00:19:07.042 Connected to database 'mythconverg' at host: localhost
2008-09-06 00:19:07.043 Current Schema Version: 0
2008-09-06 00:19:07.044 DataDirectProcessor::FixProgramIDs() -- begin
2008-09-06 00:19:07.044 New DB DataDirect connection
2008-09-06 00:19:07.044 Connected to database 'mythconverg' at host: localhost
2008-09-06 00:19:07.045 DB Error (Fixing program ids in recorded):
Query was:
UPDATE recorded SET programid=CONCAT(SUBSTRING(programid, 1, 2), '00', SUBSTRING(programid, 3)) WHERE length(programid) = 12
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.recorded' doesn't exist

2008-09-06 00:19:07.046 DB Error (Clear setting):
Query was:
DELETE FROM settings WHERE value = 'BackupDBLastRunStart' AND hostname is NULL;
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.settings' doesn't exist

2008-09-06 00:19:07.046 DB Error (SaveSettingOnHost query failure: ):
Query was:
INSERT INTO settings (value,data,hostname ) VALUES ( 'BackupDBLastRunStart', '2008-09-06 00:19:07', NULL );
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.settings' doesn't exist

2008-09-06 00:19:07.047 DB Error (StorageGroup::StorageGroup()):
Query was:
SELECT DISTINCT dirname FROM storagegroup WHERE groupname = 'DB Backups' AND hostname = 'localhost.localdomain'
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.storagegroup' doesn't exist

2008-09-06 00:19:07.047 New DB connection, total: 3
2008-09-06 00:19:07.048 Connected to database 'mythconverg' at host: localhost
2008-09-06 00:19:07.048 SG(DB Backups) Error: Directory value for Default Storage Group is empty. Using hardcoded default value of '/storage/recordings'
2008-09-06 00:19:07.049 Backing up database to file: /storage/recordings/mythconverg--20080906001907.sql
sh: /storage/recordings/mythconverg--20080906001907.sql: Permission denied
2008-09-06 00:19:07.087 DBUtil Error: Error backing up database: mysqldump --defaults-extra-file='/tmp/mythtv_db_backup_conf_uAS7XH' --host='localhost' --user='mythtv' --add-drop-table --add-locks --allow-keywords --complete-insert --extended-insert --lock-tables --no-create-db --quick 'mythconverg' > '/storage/recordings/mythconverg--20080906001907.sql' 2>/dev/null (256)
2008-09-06 00:19:07.088 DB Error (Clear setting):
Query was:
DELETE FROM settings WHERE value = 'BackupDBLastRunEnd' AND hostname is NULL;
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.settings' doesn't exist

2008-09-06 00:19:07.088 DB Error (SaveSettingOnHost query failure: ):
Query was:
INSERT INTO settings (value,data,hostname ) VALUES ( 'BackupDBLastRunEnd', '2008-09-06 00:19:07', NULL );
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.settings' doesn't exist

2008-09-06 00:19:07.223 Primary screen 0.
2008-09-06 00:19:07.223 Using screen 0, 1280x800 at 0,0
2008-09-06 00:19:07.225 Switching to square mode (blue)
2008-09-06 00:19:07.235 Using the Qt painter
mythtv: could not connect to socket
mythtv: No such file or directory
2008-09-06 00:19:07.236 lirc_init failed for mythtv, see preceding messages
2008-09-06 00:19:07.240 JoystickMenuClient Error: Joystick disabled - Failed to read /root/.mythtv/joystickmenurc
2008-09-06 00:19:08.541 DB Error (Clear setting):
Query was:
DELETE FROM settings WHERE value = 'Language' AND hostname = 'localhost.localdomain' ;
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.settings' doesn't exist

2008-09-06 00:19:08.542 DB Error (SaveSettingOnHost query failure: ):
Query was:
INSERT INTO settings (value,data,hostname) VALUES ( 'Language', 'EN', 'localhost.localdomain' );
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.settings' doesn't exist

2008-09-06 00:19:08.543 DB Error (Clear setting):
Query was:
DELETE FROM settings WHERE value = 'Language' AND hostname = 'localhost.localdomain' ;
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.settings' doesn't exist

2008-09-06 00:19:08.544 DB Error (SaveSettingOnHost query failure: ):
Query was:
INSERT INTO settings (value,data,hostname) VALUES ( 'Language', 'EN', 'localhost.localdomain' );
Driver error was [2/1146]:
QMYSQL3: Unable to execute query
Database error was:
Table 'mythconverg.settings' doesn't exist

2008-09-06 00:19:10.946 Newest Schema Version : 1214
2008-09-06 00:19:10.948 Told to create a NEW database schema, but the database
already has 10 tables.
If you are sure this is a good mythtv database, verify
that the settings table has the DBSchemaVer variable.

2008-09-06 00:19:10.948 Database Schema upgrade FAILED, unlocking.
2008-09-06 00:19:10.949 Couldn't upgrade database to new schema.

I am unclear how to fix this.

Thanks.

I am going to give this a shot when I get home on an old sata drive that i found. Just so I know how to do it in the future. But I did manage to get my old install working again.

It has some video/sound issues, but it works. I will see if I can fix them, while I am trying the upgrade process.