[mythtv-users] Restoring backup to a new backend
Paul Stillwell
bigboi at wackywombats.com
Thu Sep 24 15:03:49 UTC 2015
> On Sep 23, 2015, at 5:16 PM, John P Poet <jppoet at gmail.com> wrote:
>
>
>
> On Wed, Sep 23, 2015 at 5:43 PM Paul Stillwell <bigboi at wackywombats.com <mailto:bigboi at wackywombats.com>> wrote:
>
>> On Sep 23, 2015, at 3:52 PM, John P Poet <jppoet at gmail.com <mailto:jppoet at gmail.com>> wrote:
>>
>> On Wed, Sep 23, 2015 at 1:58 PM Paul Stillwell <bigboi at wackywombats.com <mailto: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 <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 <http://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 <http://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 <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 <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 <http://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 <http://mythconverg_restore.pl/>.
>
> John
>
I looked at the myth converge_restore.pl script and it looks like if you pass it —drop_database and —create_database then it will do the same thing as ‘mysql -u root < mc.sql’. I’m assuming that it will then restore the database based on the file passed in or the place where it is pointed to by the backuprc file. If the database is restored after —drop_database and —create_database then can I run the mysql commands to set the username and password (the ‘mysql>’ commands above)? I’m not familiar with databases so I don’t know if things need to get done in a certain order or not.
Thanks!
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20150924/72d5d5fc/attachment.html>
More information about the mythtv-users
mailing list