[mythtv-users] Restoring backup to a new backend

Mike Perkins mikep at randomtraveller.org.uk
Thu Sep 24 08:58:19 UTC 2015


On 24/09/15 01:16, John P Poet wrote:
> On Wed, Sep 23, 2015 at 5:43 PM Paul Stillwell <bigboi at wackywombats.com>
> wrote:
>
>>
>> On Sep 23, 2015, at 3:52 PM, John P Poet <jppoet at gmail.com> wrote:
>>
>> On Wed, Sep 23, 2015 at 1:58 PM Paul Stillwell <bigboi at wackywombats.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I’m trying to build a new backend system. I backed up the database and
>>> then saved it on an external drive. I then installed a new hard drive and
>>> installed Fedora 22 and then installed mythtv from RPMFusion. I read this
>>> link
>>> https://www.mythtv.org/wiki/Backend_migration#Building_a_new_backend_to_replace_an_existing_machine which
>>> basically said all I need to do after installing myth is to restore the
>>> backup. I tried to restore the backup with mythconverg_restore.pl and I
>>> get an ‘Unable to connect to database’ error. Do I need to run the restore
>>> command with the —create_database option or should I do something else?
>>>
>>
>> Yes, you would need to create the DB.  Also, if you have not done so, you
>> need to get mysql daemon up and running -- set the password, etc. before
>> the restore script will be able to write to the DB.
>>
>> For example:
>> mysql> create user 'mythtv'@'192.168.1.%' identified by 'mythtv';
>> mysql> set password for 'mythtv'@'192.168.1.%' = password('mythtv');
>> mysql> grant all on mythconverg.* to 'mythtv'@'192.168.1.%' identified by
>> 'mythtv';
>> mysql> flush privileges;
>>
>> Also remember to run (at least for Fedora):
>> $ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql --user=root -p mysql
>> to get the timezone configured correctly.
>>
>> John
>>
>>
>> John, thanks for the info! OK, just so I have the steps right, it would
>> look like this:
>>
>> 1. Enable the mariaBD service
>> 2. Start the mariaDB service
>> 3. Create the initial database by doing this: mysql -u root < mc.sql
>> 4. Do the SQL steps above by doing this:
>>
>> mysql> create user 'mythtv'@'192.168.1.%' identified by 'mythtv';
>> mysql> set password for 'mythtv'@'192.168.1.%' = password('mythtv');
>> mysql> grant all on mythconverg.* to ‘mythtv’@'192.168.1.%' identified by
>> 'mythtv';
>>
>> mysql> flush privileges;
>>
>> 5. Run the mysql_tzinfo… to get the timezone info correct
>> 6. Run mythconverg_restore.pl to restore the database
>>
>> Do those sound like the right steps? Did I miss anything? When I googled
>> for this info I get some slightly different steps from
>> https://www.mythtv.org/wiki/User_Manual:Initial_Installation#MythTV_database_setup and
>> from
>> https://www.mythtv.org/wiki/MythTV-HOWTO_-_0.27#Red_Hat_Linux_and_Fedora
>> I’m not sure which of those should be consulted when doing this. This is
>> one of those processes that I do so infrequently that I have to look around
>> each time I do it.
>>
>
> I *think* you can skip the `mysql -u root < mc.sql`, if you are
> passing --create_database option to mythconverg_restore.pl, but it has been
> a long time since I did this.  You can always play with it until you get it
> right.  If you need to start over, just pass both
> "--drop_database --create_database" to mythconverg_restore.pl.
>
If you use the --create_database option, the script has to know where the mc.sql file is. This is 
usually in the .mythtv/backuprc file.

-- 

Mike Perkins



More information about the mythtv-users mailing list