Hi,
I have two OPSI servers e.g "opsi-old" and "opsi-new". "opsi-new" is mirrored "opsi-old" (same clients, packages, licenses, config, but with mysql backends for all). Now I need to change name of "opsi-new" to "opsi-old", so all existing clients will connect to the new server. What steps should I take now? What commands are necessary to rename Depot Server (Depot Server=Config server; only one).
OPSI v. 4.0.5@CentOS 7
Change name of OPSI server
Re: Change name of OPSI server
I know this is an old topic, but I have struggled with OPSI server (config server + depot) renaming today so I can share my experience..
If you want to rename your server:
1. Change hostname and/or domainname
In my tests I was trying to rename opsi.local.lan VM (provided by OPSI team, Xubuntu) to opsinew.local.lan
2. Execute:
in my case:
That's it but not really..
a) Client's could not mount depot shares, because they were looking not for \\opsinew\opsi_depot, but \\opsinew\opsinew_depot – you have to edit /etc/samba/smb.conf or client config..
b) I have found a bug..
/var/lib/opsi/config/depots/opsinew.local.lan.ini
Now it looks like everything is OK I am going to rename production server..
If you want to rename your server:
1. Change hostname and/or domainname
In my tests I was trying to rename opsi.local.lan VM (provided by OPSI team, Xubuntu) to opsinew.local.lan
Code: Alles auswählen
# sed -i 's/opsi/opsinew/' /etc/hostname
# sed -i 's/opsi/opsinew/g' /etc/hosts
# reboot
Code: Alles auswählen
opsi-admin --no-depot -d method host_renameOpsiDepotserver <old-id> <new-id>
Code: Alles auswählen
# opsi-admin --no-depot -d method host_renameOpsiDepotserver opsi.local.lan opsinew.local.lan
Code: Alles auswählen
# service opsiconfd restart
a) Client's could not mount depot shares, because they were looking not for \\opsinew\opsi_depot, but \\opsinew\opsinew_depot – you have to edit /etc/samba/smb.conf or client config..
b) I have found a bug..
String opsi was replaced multiple times in some places and I have got opsinewnew instead of opsinew so package management was not working until I fixed:# opsi-admin -d method host_getObjects [] '{"type":"OpsiDepotserver"}'
[
{
"masterDepotId" : null,
"ident" : "opsinew.local.lan",
"networkAddress" : "192.168.1.0/255.255.255.0",
"description" : "",
"inventoryNumber" : "",
"ipAddress" : "192.168.1.200",
"repositoryRemoteUrl" : "webdavs://opsinewnew.local.lan:4447/repository",
"depotLocalUrl" : "file:///var/lib/opsi/depot",
"isMasterDepot" : true,
"notes" : "",
"hardwareAddress" : "08:00:27:0d:9a:35",
"maxBandwidth" : 0,
"repositoryLocalUrl" : "file:///var/lib/opsi/repository",
"opsiHostKey" : "feee94fbcb126b763bd88f0a02c89a5f",
"type" : "OpsiConfigserver",
"id" : "opsinew.local.lan",
"depotWebdavUrl" : "webdavs://opsinewnew.local.lan:4447/depot",
"depotRemoteUrl" : "smb://opsinew/opsinew_depot"
}
]
/var/lib/opsi/config/depots/opsinew.local.lan.ini
Now it looks like everything is OK I am going to rename production server..
- n.wenselowski
- Ex-uib-Team
- Beiträge: 3194
- Registriert: 04 Apr 2013, 12:15
Re: Change name of OPSI server
Hi mirkt,
Probably it would be better to be a little bit more selective when parsing urls.
Kind regards
Niko
PS: General warning: We do not recommend editing the backend directly as an error there can have ugly side effects.
Our way of renaming is to iterate over all the configurations and then change the old id to the new id. As you noted this has some issues if the old hostname was just opsi. We have a ticket open for this.mirkt hat geschrieben:a) Client's could not mount depot shares, because they were looking not for \\opsinew\opsi_depot, but \\opsinew\opsinew_depot – you have to edit /etc/samba/smb.conf or client config..
b) I have found a bug..String opsi was replaced multiple times in some places and I have got opsinewnew instead of opsinew so package management was not working until I fixed:# opsi-admin -d method host_getObjects [] '{"type":"OpsiDepotserver"}'
[
{
"masterDepotId" : null,
"ident" : "opsinew.local.lan",
"networkAddress" : "192.168.1.0/255.255.255.0",
"description" : "",
"inventoryNumber" : "",
"ipAddress" : "192.168.1.200",
"repositoryRemoteUrl" : "webdavs://opsinewnew.local.lan:4447/repository",
"depotLocalUrl" : "file:///var/lib/opsi/depot",
"isMasterDepot" : true,
"notes" : "",
"hardwareAddress" : "08:00:27:0d:9a:35",
"maxBandwidth" : 0,
"repositoryLocalUrl" : "file:///var/lib/opsi/repository",
"opsiHostKey" : "feee94fbcb126b763bd88f0a02c89a5f",
"type" : "OpsiConfigserver",
"id" : "opsinew.local.lan",
"depotWebdavUrl" : "webdavs://opsinewnew.local.lan:4447/depot",
"depotRemoteUrl" : "smb://opsinew/opsinew_depot"
}
]
/var/lib/opsi/config/depots/opsinew.local.lan.ini
Probably it would be better to be a little bit more selective when parsing urls.
Kind regards
Niko
PS: General warning: We do not recommend editing the backend directly as an error there can have ugly side effects.
Code: Alles auswählen
import OPSI