LinHES Forums http://forum.linhes.org/ |
|
How can I copy keybindings from one FE to another w/MySQL? http://forum.linhes.org/viewtopic.php?f=11&t=14560 |
Page 1 of 1 |
Author: | mihanson [ Mon Mar 12, 2007 8:49 pm ] |
Post subject: | How can I copy keybindings from one FE to another w/MySQL? |
It seems simple enough, but I cannot figure this one out. I've googled and searched the mythtv mailng list. I want to copy the keybindings from my main mythtv box "mythbox" to a new frontend "mythbox-rfe-2." I found this on the mythtv mailing list: Code: REPLACE INTO settings (data, value, hostname) and substituted the proper table (keybindings, instead of settings) and also changed the column names to the colum names in keybindings, but it does not work (which was noted later in the thread). So my syntax was:SELECT (data, value, "new_host") FROM settings WHERE hostname = "old_host"; Code: REPLACE INTO keybindings (context, action, description, keylist, hostname)
SELECT (context, action, description, keylist, "mythbox-rfe-2") FROM keybindings WHERE hostname = "mythbox"; and I get this error: Quote: ERROR 1241 (21000): Operand should contain 1 column(s)
I tried using mythweb to manually adjust each keybinding, but nothing sticks except for on the master backend ("mythbox"). I'm obviously not a MySQL genius. Does anyone know how this can be done? |
Author: | khrusher [ Tue Mar 13, 2007 6:50 am ] |
Post subject: | |
First off....Please have a good, current backup before manually running SQL against your database you want to insert not replace and you need to lose some parens... Code: insert INTO keybindings (context, action, description, keylist, hostname)
SELECT context, action, description, keylist, "mythbox-rfe-2" FROM keybindings WHERE hostname = "mythbox"; |
Author: | mihanson [ Tue Mar 13, 2007 11:04 am ] |
Post subject: | |
Thanks khrusher. I'll give this a try later when I have time to make a backup (and time to restore if I screw it up.) The new frontend machine "mythbox-rfe-2" is already online, so it already has entries in the keybindings table. I believe I do want to use the replace command. Is it as straight forward as substituting "replace" where you wrote "insert"? Thank you very much! ![]() |
Author: | khrusher [ Wed Mar 14, 2007 6:29 am ] |
Post subject: | |
it can be tricky to 'merge' the data from the front ends... Are there keybindings for your second front end that you dont want overwritten? If so are there many? If you want all of the keybindings from FE1 to be duplicated to FE2, the easiest way would be to delete the existing FE2 records and then do the insert from FE1. Code: delete from keybindings WHERE hostname = "mythbox-rfe-2";
insert INTO keybindings (context, action, description, keylist, hostname) SELECT context, action, description, keylist, "mythbox-rfe-2" FROM keybindings WHERE hostname = "mythbox"; Otherwise you'll need to build a more complicated 'WHERE' clause to tell the SQL statement which "mythbox-rfe-2" keybinding records should be replaced or updated by which particular "mythbox" records. (or conversely, tell the SQL which record NOT to update) If there are only a few difference between the "mythtv" settings and the final desired "mythbox-rfe-2", might be easier to do the delete, update as above then manually make the "mythbox-rfe-2" adjustments. |
Author: | mihanson [ Wed Mar 14, 2007 1:21 pm ] |
Post subject: | |
khrusher wrote: it can be tricky to 'merge' the data from the front ends...
Are there keybindings for your second front end that you dont want overwritten? If so are there many? If you want all of the keybindings from FE1 to be duplicated to FE2, the easiest way would be to delete the existing FE2 records and then do the insert from FE1. No, there are no keybindings on "mythbox-rfe-2" that I want to save. Your method of deleting them all and then inserting sounds like the way to go. I'll give it a shot. Thank you for your help. |
Author: | mihanson [ Wed Mar 14, 2007 5:56 pm ] |
Post subject: | |
Thanks khrusher, that seemed to do the trick. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |