From LinuxMCE
Jump to: navigation, search

Restoring Your Mythtv Recording DB After an Upgrade/Re-Install

So you wish to upgrade your LMCE installation, or while tweaking it to your liking, you managed to make your current install unstable, or there is a problem with your database causing errors, and resulting in a loss of functionality. And you decide to re-install LMCE. But up until now, you have been massing up large quantities of mythtv recordings. This howto will be an attempt at trying to get you back up and running, and still keep your mythtv recordings database current.


1. LMCE 710 RC1 or RC2 DVD

2. Backup of current mythtv database - mythconverg

3. Fully set-up MythTV in LMCE


1. Insure that all files you want to keep are moved or copied to /home .

2. Get a current dump of the mythconverg database.

Backup Current DB

Lets get a current dump of your mythconverg database. I recommend dumping the resulting file into /home , that way when you re-install keeping /home, you don't lose your dump ;)

mysqldump -u root -p mythconverg -c > /home/old_mythtv.sql

This will take a bit depending on how much data you have recorded/scheduled. Once this is complete, you can now safely begin your re-install.

Install LMCE Keeping /home

Boot up your LMCE DVD and begin the install process. Please make sure at the minimum you keep /home. You will be asked this before the install begins. Now sit back a while and wait for the install to finish. Once it is done, proceed through the normal set up steps, get your Media Director bits completed. When this is done you should have a functional MythTV install.

Install phpMyadmin

Next on our list, we want to install phpMyadmin. This will make it very easy to get back your recording information into the mythconverg database. So lets get started:

sudo apt-get update
sudo apt-get install phpmyadmin

Now when I tried this, I was not prompted for the setup information, so of course it did not work. I re-ran the setup by doing:

sudo dpkg-reconfigure phpmyadmin

When the ncurses menu shows up select "apache2" and then hit "OK" Now you should have a functional phpMyAdmin located @ http://dcerouter/phpmyadmin/

Copying your data to the new database

Now you can use phpMyAdmin to create a temporary database for old_mythtv, or use the command line:

(A note here, if you did not change it, the root password is blank, just hit enter, if you did change it (recommended) then you know what it is already)

mysql -u root -p 
create database old_mythtv;

Next we import the old database:

mysql -u root -p old_mythtv < /home/old_mythtv.sql

Now you should have a populated database with your old mythtv settings.

(another note here, this only covers restoring your recording information, however, the entire mythconverg database is there, so if there are some other items you wish to restore, now is the time)

From a web browser inside your network, go to the phpMyAdmin page http://dcerouter/phpmyadmin

1. Log in as user root.

2. Select the old_mythtv database from the drop-down box in the panel on the left.

3. Use the table below for the items to be restored.

4. Click the table in the left panel you wish to copy.

5. Click the "Operations" tab along the top of the right panel.

6. You should see a box in the right panel now called "Copy table to (database.table):"

7. In this box use the drop down to select the "mythconverg" database

8. Insure the "Structure and Data" radio button is "ticked", also "tick" the "Add DROP TABLE" option.

9. Now click "Go"

That should complete and now you have begun restoring tables:

List of Tables to be restored:


Now, reboot the system. When it comes back up, all your mythtv recordings/schedules should be back in view from the MythTV Plugin window.

I hope this helps someone, it took me some googling to get all the relevant info, a lot can be attributed to this link:

Moving your data to new hardware