View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 19 posts ] 
Go to page 1, 2  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Changing hostname
PostPosted: Mon Jan 23, 2006 1:30 am 
Offline
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location: California
I just installed a second myth server and I made the mistake of not changing it's name, so I have two machines with the name "mythtv" on my network. I want to change the name of the new one. I tried modifying "/etc/hostname" with the new name and rebooting, but after a reboot the backend process didn't start properly and I had the following error on the myth log file:

Quote:
2006-01-22 22:33:05.584 New DB connection, total: 1
No setting found for this machine's BackendServerIP.
Please run setup on this machine and modify the first page
of the general settings.
2006-01-22 22:42:56.323 New DB connection, total: 1
No setting found for this machine's BackendServerIP.
Please run setup on this machine and modify the first page
of the general settings.



I re-ran the setup program and it didn't show an tuner cards anymore, so I've set the hostname back to "mythtv" for now.

Is there a way I can do this rename without messing things up? Thanks!

Marc


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 1:52 am 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
Perhaps reading the MythTV docs? Settings in the db are associated with hostname. So if you change the hostname, you must reconfigure or read the MythTV docs...

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 8:23 am 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
also there are some threads on this forum about how to do it. Basically it's a very messy process.

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 06, 2006 5:39 am 
Offline
Joined: Sat Dec 03, 2005 5:59 pm
Posts: 111
Location: Sydney, Australia
What about doing an Upgrade (or just using the currently installed version, but selecting 'Upgrade' from the boot menu) and then choosing a hostname other than 'mythtv' when prompted? Would that modify the backed-up database appropriately, as part of the upgrade process? And if not, what would the outcome be, eg. a total mess... :?:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 06, 2006 7:39 am 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
Read my original statement.

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject: same problem here
PostPosted: Sun Mar 26, 2006 7:46 pm 
Offline
Joined: Mon Nov 07, 2005 10:09 am
Posts: 153
i have the same problem.

I think it could be behind all my problems with the backend slave how-to.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 26, 2006 8:23 pm 
Offline
Joined: Sat Dec 03, 2005 5:59 pm
Posts: 111
Location: Sydney, Australia
:? Sorry to harp on this, Ces, but what about what ceenvee703 suggests in this post http://mysettopbox.tv/phpBB2/viewtopic. ... 7&start=15
Quote:
Fixed by entering mysql and setting the host name to the hostname of my backend (the installed default of "mythtv")
Code:
root@mythtv:/var/log/mythtv# mysql -u root mythconverg
mysql> UPDATE recorded SET hostname='mythtv';


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 26, 2006 10:43 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Not good enough. Seriously. I have done this in the past by editing the DB dump created by backup. It's a big ugly job and it's really easy to screw up. It may take multiple tries to get it right. Still that's the easiest way. Reading the MythTV docs will give you the information you need to do this intelligently.

BTW - Why is getting people to read the manual harder than getting a pill into a cat? We're not telling you to RTFM just for fun. It contains information that you need to do this. Anything we told you would be either incomplete or essentially copying the contents of the manual. Both of which would be pretty silly things for us to do.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 27, 2006 10:08 pm 
Offline
Joined: Mon Nov 07, 2005 10:09 am
Posts: 153
The instructions regarding how to change the hostname in the manual are very clear although i haven't tried it.
I think there is some mysticism preventing people from trusting TFM because they get used to knoppmyth (thanks to other users and developers) taking care of all of the details for them and don't know if TFM still applies to a customized distribution. How customized is it we don't know so when in doubt we just use all the defaults and cross our fingers.
Next check out the wiki, then these forums, then mythtv wiki, then last the mythtv docs... then post a question here.
Its hard for people to transition from handholding during the install to crawling and then walking on their own. But if you want to try new things like multiple systems its a new level of complexity and risk but that curiosity requires more independent research and trying first what is written.

Before I even think about changing the hostname I am going to get to know the database better. I have been using phpmyadmin to fix the channel table with my dvb settings and it has been a good learning experience.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 27, 2006 11:20 pm 
Offline
Joined: Fri Sep 19, 2003 7:05 pm
Posts: 5088
Location: Fontana, Ca
MythTV is in NO way customized for KnoppMyth. There is no reason to think that what is pointed out in the MythTV manual won't work the same for KnoppMyth. Since starting the distribution, I've advocated reading the MythTV docs. While KnoppMyth makes some items easier, not reading the docs for the various apps included is no excuse. This is especially true is I tell you to read the docs.

_________________
cesman

When the source is open, the possibilities are endless!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 3:21 pm 
Offline
Joined: Tue Aug 08, 2006 7:08 pm
Posts: 561
Location: UK
Follwed the instructions in Section 23.15 of the MythTV docs, everything seems to have went OK.
In the MythTV docs acessable from Knoppmyth ( http://knoppmythbox/mythtv-doc/mythtv-H ... .html#ss23 ) web interface, there appears to be a slight correction required to the backend stop and start instructions, instead of :
Code:
$ su
# /etc/init.d/mythbackend stop

it needs to be:
Code:
$ su
# /etc/init.d/mythtv-backend stop


and the the same for the start, of course.

_________________
Updated 2019/10/26: AthlonII X2 265 Gigabyte GA-970A-DS3P
16Gb PC 1866 DDR3, 500GB+2TB+4TB SATA HDD,
SATA DVD-RW Asus DRW-24D5MT , NVIDIA GeForce GT1080
Hauppauage Nova-T 500, Nova-T LinHes R8.6.1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 1:13 am 
Offline
Joined: Fri Jul 29, 2005 1:22 am
Posts: 232
Location: SF East Bay, CA
bruce_s01 wrote:
Follwed the instructions in Section 23.15 of the MythTV docs, everything seems to have went OK.

Link: http://www.mythtv.org/docs/mythtv-HOWTO-23.html#ss23.15

_________________
// Brian - Hardware:
ASUS P5P800 - P4 3Ghz, 500 GB PATA HD
ASUS P5K-V - P4 Core2 Duo, 500 GB SATA HD
Hauppauge PVR-350, IR Blaster, Comcast Digital Cable
http://tech.groups.yahoo.com/group/KnoppMyth/
KnoppMyth R5F27 >> R5.5


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 8:58 am 
Offline
Joined: Sat Sep 02, 2006 9:17 am
Posts: 359
I accidently renamed when I rebuild my FC 4 box with KM I didn't realize FC added ".localdomain" ...worst upgrade ever. (not KM's fault of course)

I tried all sorts of stuff to get the backup 'corrected' and reimported and failed every time. I eventually took the dumps, and wrote a monster of a grep/sed/awk script (I wish I knew perl) that eventually got the recording data inserted into videometadata instead of the recordings tables, I moved the files from the FC4 recordings folder into KM's /myth/videos and was able to watch my old recordings through mythvideo. YMMV.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 8:39 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
I wrote an experimental SQL script to do this the problem was finding someone with time and an opportunity to test it.... Maybe I'll post it with the caveat that it's untested and needs someone desperate or crazy enough to try it...


Top
 Profile  
 
 Post subject: Repost... Caveat Utor!
PostPosted: Tue Oct 02, 2007 8:44 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Insert blood curdling warning here. I _believe_ that this is correct, but it's utterly untested. Make sure you have a current DB backup before you even think about trying this. Use at you own risk...

Anybody have a sacrificial machine handy to try this on? Thx...

BTW - If you grab this remember to watch out for trailing blanks after the three \ continuation lines...
Code:
root@black2:~# cat change_hostname.sh
#!/bin/bash

old="$1"
new="$2"

fatal () {
    echo "Error! $*"
    exit 1
}
nl='
'
usage () {
    fatal "$*${nl}Usage: $0 old_hostname new_hostname"
}

[ $(id -u) -ne 0 ] && fatal "You must run this script as root!"
[ $# -ne 2 ] && usage "Bad argument count!"
[ -z "$old" ] && fatal "Old hostname can not be blank!"
[ -z "$new" ] && fatal "New hostname can not be blank!"

echo
echo "=============================== WARNING! =============================="
echo "This only changes the hostnames stored in the database. Also, if mysql"
echo "complains about uniqueness you'll need to resolve the issue manually."
echo "=============================== WARNING! =============================="
echo
read -p "Hit enter to continue, or Ctrl-C to abort."

# Tables which contain hostname
for table in capturecard inuseprograms jobqueue jumppoints keybindings \
             music_playlists musicplaylist profilegroups recorded settings ; do
    mysql mythconverg -u root -e \
        "update $table set hostname = '$new' where hostname = '$old'"
done

# Tables which contain host
for table in mythlog ; do
    mysql mythconverg -u root -e \
        "update $table set host = '$new' where host = '$old'"
done


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ] 
Go to page 1, 2  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu