[gelöst] Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Antworten
DS.Infra
Beiträge: 7
Registriert: 20 Jan 2022, 14:49

[gelöst] Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von DS.Infra »

Hallo,

ich versuche gerade unseren unseren Opsi Server 4.1 / Centos7 auf Opsi Server 4.2 / RockLinux8.
Da das mit dem Betriebssystemupdate hochziehen nicht so geklappt hat, war mein Plan.

Ich installiere das Rocky und den OpsiServer neu was auch klappte ich kann mich anmelden,
und importiere dann das Backup was ich mit opsi-backup erstellt habe aber ich erhalte immer eine
Fehlermeldung, was mache ich falsch hat jemand einen Tip?

Code: Alles auswählen

[root@dssopsi04 ~]# opsi-backup -v  restore /root/opsibackup-20220909.tar.bz2 --new-server-id dssopsi04.domain.xxx  --backends mysql
[5] [2022-09-09 13:57:56.193] [               ] Archive /root/opsibackup-20220909.tar.bz2 is OK.   (Backup.py:182)
WARNING: Your system config is different from the one recorded with this backup.
This means the backup was probably taken for another machine and restoring it might leave this opsi installation unusable.
Do you wish to continue? [y/N] y
[5] [2022-09-09 13:57:58.142] [               ] Restoring data from backup archive /root/opsibackup-20220909.tar.bz2.   (Backup.py:272)
[5] [2022-09-09 13:58:00.808] [               ] Restoration complete   (Backup.py:324)
[5] [2022-09-09 13:58:00.809] [               ] Ignoring module 'OpsiPXEConfd', backend 'opsipxeconfd'   (Dispatcher.py:134)
[5] [2022-09-09 13:58:00.981] [               ] Parsing dispatch.conf   (CleanupBackend.py:47)
[5] [2022-09-09 13:58:00.981] [               ] Mysql-backend detected. Trying to cleanup mysql-backend first   (CleanupBackend.py:73)
[5] [2022-09-09 13:58:00.982] [               ] Connection to database 'opsi' on '127.0.0.1' as user 'opsi'   (CleanupBackend.py:238)
[5] [2022-09-09 13:58:00.984] [               ] Cleaning up defaultValues in productProperties   (CleanupBackend.py:244)
[5] [2022-09-09 13:58:01.006] [               ] Cleaning up groups   (CleanupBackend.py:78)
[5] [2022-09-09 13:58:01.013] [               ] Cleaning up products   (CleanupBackend.py:81)
[5] [2022-09-09 13:58:02.029] [               ] Cleaning up product on depots   (CleanupBackend.py:92)
[5] [2022-09-09 13:58:02.058] [               ] Cleaning up product on clients   (CleanupBackend.py:95)
[5] [2022-09-09 13:58:02.214] [               ] Cleaning up product properties   (CleanupBackend.py:98)
[5] [2022-09-09 13:58:02.714] [               ] Cleaning up product property states   (CleanupBackend.py:120)
[5] [2022-09-09 13:58:03.090] [               ] Cleaning up config states   (CleanupBackend.py:215)
[5] [2022-09-09 13:58:03.106] [               ] Cleaning up audit softwares   (CleanupBackend.py:218)
[5] [2022-09-09 13:58:08.061] [               ] Cleaning up audit software on clients   (CleanupBackend.py:221)
[5] [2022-09-09 13:58:08.458] [               ] Renaming config server to 'dssopsi04.domain.xxx'   (Backup.py:329)
[5] [2022-09-09 13:58:08.458] [               ] Ignoring module 'OpsiPXEConfd', backend 'opsipxeconfd'   (Dispatcher.py:134)
[5] [2022-09-09 13:58:08.624] [               ] Creating base path: '/var/lib/opsi/config'   (File.py:232)
[5] [2022-09-09 13:58:08.673] [               ] Creating opsi base   (SQL.py:621)

ERROR: Failed to rename config server to 'dssopsi04.domain.xxx': Backend error: Cannot rename: host 'dssopsi04.domain.xxx' already exists

[root@dssopsi04 ~]#
Danke gruß
Hauke
Zuletzt geändert von DS.Infra am 05 Okt 2022, 10:39, insgesamt 1-mal geändert.
Benutzeravatar
fkalweit
uib-Team
Beiträge: 173
Registriert: 23 Okt 2020, 16:14

Re: Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von fkalweit »

Hallo,

hilft es evt die opsi DB auf dem neuen Server erst mal zu löschen?

DROP DATABASE opsi;

Viele Grüße
Fabian
DS.Infra
Beiträge: 7
Registriert: 20 Jan 2022, 14:49

Re: Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von DS.Infra »

Hallo,

tut mir leid für die späte Antwort.

Ich habe es getestet leider kommt jetzt die Info:

Code: Alles auswählen

[root@dssopsi04 ~]# opsi-backup -v  restore /root/opsibackup-20220909.tar.bz2 --new-server-id dssopsi04.domain.xxx  --backends mysql

ERROR: (MySQLdb.OperationalError) (1049, "Unknown database 'opsi'")
(Background on this error at: https://sqlalche.me/e/14/e3q8)
Ich habe mit
opsi-setup --configure-mysql

Die DB wieder angelegt, aber die Fehlermeldung aus meinem ersten Meldung ist exact wieder da. Ich habe nochmal getestet wenn ich den Host
einen anderen Server angebe.

Code: Alles auswählen

root@dssopsi04 ~]# opsi-backup -v  restore /root/opsibackup-20220909.tar.bz2 --new-server-id dssopsi05.domain.xxx  --backends mysql
[5] [2022-09-29 11:02:35.835] [               ] Archive /root/opsibackup-20220909.tar.bz2 is OK.   (Backup.py:182)
WARNING: Your system config is different from the one recorded with this backup.
This means the backup was probably taken for another machine and restoring it might leave this opsi installation unusable.
Do you wish to continue? [y/N] y
[5] [2022-09-29 11:02:37.400] [               ] Restoring data from backup archive /root/opsibackup-20220909.tar.bz2.   (Backup.py:272)
[5] [2022-09-29 11:02:39.747] [               ] Restoration complete   (Backup.py:324)
[5] [2022-09-29 11:02:39.758] [               ] Ignoring module 'OpsiPXEConfd', backend 'opsipxeconfd'   (Dispatcher.py:134)
[5] [2022-09-29 11:02:39.921] [               ] Parsing dispatch.conf   (CleanupBackend.py:47)
[5] [2022-09-29 11:02:39.921] [               ] Mysql-backend detected. Trying to cleanup mysql-backend first   (CleanupBackend.py:73)
[5] [2022-09-29 11:02:39.921] [               ] Connection to database 'opsi' on '127.0.0.1' as user 'opsi'   (CleanupBackend.py:238)
[5] [2022-09-29 11:02:39.924] [               ] Cleaning up defaultValues in productProperties   (CleanupBackend.py:244)
[5] [2022-09-29 11:02:39.948] [               ] Cleaning up groups   (CleanupBackend.py:78)
[5] [2022-09-29 11:02:39.949] [               ] Cleaning up products   (CleanupBackend.py:81)
[5] [2022-09-29 11:02:40.336] [               ] Cleaning up product on depots   (CleanupBackend.py:92)
[5] [2022-09-29 11:02:40.364] [               ] Cleaning up product on clients   (CleanupBackend.py:95)
[5] [2022-09-29 11:02:40.524] [               ] Cleaning up product properties   (CleanupBackend.py:98)
[5] [2022-09-29 11:02:41.005] [               ] Cleaning up product property states   (CleanupBackend.py:120)
[5] [2022-09-29 11:02:41.375] [               ] Cleaning up config states   (CleanupBackend.py:215)
[5] [2022-09-29 11:02:41.390] [               ] Cleaning up audit softwares   (CleanupBackend.py:218)
[5] [2022-09-29 11:02:46.530] [               ] Cleaning up audit software on clients   (CleanupBackend.py:221)
[5] [2022-09-29 11:02:46.960] [               ] Renaming config server to 'dssopsi05.domain.xxx'   (Backup.py:329)
[5] [2022-09-29 11:02:46.970] [               ] Ignoring module 'OpsiPXEConfd', backend 'opsipxeconfd'   (Dispatcher.py:134)
[5] [2022-09-29 11:02:47.131] [               ] Creating base path: '/var/lib/opsi/config'   (File.py:232)
[5] [2022-09-29 11:02:47.179] [               ] Creating opsi base   (SQL.py:621)

ERROR: Failed to rename config server to 'dssopsi05.domain.xxx': Backend unaccomplishable error: Filebackend can only handle this config server 'dssopsi04.domain.xxx', not 'dssopsi05.domain.xxx'

[root@dssopsi04 ~]#
Ich stehe etwas auf dem schlauch ich habe auch kein Problem die VM neuaufzusetzen, aber ich würde gerne verstehen was sein Problem ist.
Danke Hauke
Benutzeravatar
wolfbardo
uib-Team
Beiträge: 1354
Registriert: 01 Jul 2008, 12:10

Re: Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von wolfbardo »

Eventuell ist das Filebackend auf dem Zielserver noch aktiv und es hilft
rm /var/lib/opsi/config/depots/*ini
Gruss
Bardo Wolf


OPSICONF 2024
https://opsi.org/en/opsiconf/

opsi-Basisworkshops:

22. - 25. 04. 2024


opsi support - uib gmbh
For productive opsi installations we recommend maintainance + support contracts which are the base of opsi development.

http://www.uib.de
DS.Infra
Beiträge: 7
Registriert: 20 Jan 2022, 14:49

Re: Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von DS.Infra »

Hallo,

leider hat das auch nicht geholfen, dann kommt jetzt die Meldung:

Code: Alles auswählen

[5] [2022-09-30 12:05:10.913] [               ] Renaming config server to 'dssopsi05.domain.xxx'   (Backup.py:329)
[5] [2022-09-30 12:05:10.914] [               ] Ignoring module 'OpsiPXEConfd', backend 'opsipxeconfd'   (Dispatcher.py:134)
[5] [2022-09-30 12:05:11.128] [               ] Creating base path: '/var/lib/opsi/config'   (File.py:232)
[5] [2022-09-30 12:05:11.180] [               ] Creating opsi base   (SQL.py:621)

ERROR: Failed to rename config server to 'dssopsi05.domain.xxx': No config server found in backend
Ich würde jetzt vielleicht nochmal von vorne anfangen, daher hätte ich gerne einmal Feedback ob mein vorgehen überhaupt richtig ist.

A.) Opsi-Altsystem (Opsi4.1 / Centos7) Backup mit OPSI-Backup
B.) Opsi-Neusystem (Opsi4.2 / Rocket8)
B.1) Opsi Grundinstallation nach Anleitung
B.2) Backup einspielen

Oder habe ich hier einen Denkfehler?

gruß
Hauke
thomas.besser
Beiträge: 455
Registriert: 09 Sep 2009, 09:40

Re: Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von thomas.besser »

Das wird so IMO nicht funktionieren. Wenn ich mich recht erinnere, dann muss die installierte OPSI-Version beim Einspielen des Backups diesselbe sein, wie beim Sichern.

Sprich: Backup mit 4.1, dann muss das Einspielen auch mit 4.1 erfolgen.
magicalUnicorn
Beiträge: 117
Registriert: 07 Mär 2019, 14:46

Re: Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von magicalUnicorn »

Sprich: Backup mit 4.1, dann muss das Einspielen auch mit 4.1 erfolgen.
Da kann ich aus eigener Erfahrung das Gegenteil berichtet. Wechseln von Oracle 7 auf Oracle 8. Auf Oracle 7 das Backup mit 4.1 gemacht und unter Oracle 8 in 4.2 importiert.
thomas.besser
Beiträge: 455
Registriert: 09 Sep 2009, 09:40

Re: Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von thomas.besser »

Ok, dann wurde das mit 4.2 geändert.

Meine Erfahrung basiert noch von 4.0 -> 4.1 (viewtopic.php?p=54032#p54032)
DS.Infra
Beiträge: 7
Registriert: 20 Jan 2022, 14:49

Re: Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von DS.Infra »

Hallo, danke für das Feedback
magicalUnicorn hat geschrieben: 30 Sep 2022, 13:08 Da kann ich aus eigener Erfahrung das Gegenteil berichtet. Wechseln von Oracle 7 auf Oracle 8. Auf Oracle 7 das Backup mit 4.1 gemacht und unter Oracle 8 in 4.2 importiert.
Wir war denn dort der Weg, hast du da vielleicht was anders gemacht, beim Backup oder zurück sichern?

Danke gruß
Hauke
DS.Infra
Beiträge: 7
Registriert: 20 Jan 2022, 14:49

Re: Backup Einspielen - Backend error: Cannot rename: host 'opsi04.local.' already exists

Beitrag von DS.Infra »

Hallo,

ich habe meinen Fehler gefunden.

Ich habe bei der Installation, anscheind fast alles richtig gemacht.
Da auf dem Altsystem die mysql als Backende hatte und ich in der Config vom neuen Server, das anscheind nur halb
gemacht hatte, schlug das wohl fehl:

Code: Alles auswählen

more /etc/opsi/backendManager/dispatch.conf
backend_.* : file, mysql, opsipxeconfd
host_.* : file, opsipxeconfd
productOnClient_.* : file, opsipxeconfd
configState_.* : file, opsipxeconfd
license.* : mysql
softwareLicense.* : mysql
audit.* : mysql
.* : file
Nach dem ich es angepasst habe:

Code: Alles auswählen

more /etc/opsi/backendManager/dispatch.conf
backend_.* : mysql, opsipxeconfd
host_.* : mysql, opsipxeconfd
productOnClient_.* : mysql, opsipxeconfd
configState_.* : mysql, opsipxeconfd
license.* : mysql
softwareLicense.* : mysql
audit.* : mysql
.* : mysql

# Die Schritte laut Doku nach der Backendanpassung, habe ich gemacht
opsi-setup --init-current-config
opsi-setup --set-rights
systemctl restart opsiconfd.service
systemctl restart opsipxeconfd.service

#Dann lief das Backup durch
[root@dssopsi05 ~]# opsi-backup -v  restore /root/opsibackup-20220909.tar.bz2 --new-server-id dssopsi05.domain.xxx  --backends mysql
[5] [2022-10-05 08:35:10.201] [               ] Archive /root/opsibackup-20220909.tar.bz2 is OK.   (Backup.py:182)
WARNING: Your system config is different from the one recorded with this backup.
This means the backup was probably taken for another machine and restoring it might leave this opsi installation unusable.
Do you wish to continue? [y/N] y
[5] [2022-10-05 08:35:11.607] [               ] Restoring data from backup archive /root/opsibackup-20220909.tar.bz2.   (Backup.py:272)
[5] [2022-10-05 08:35:14.056] [               ] Restoration complete   (Backup.py:324)
[5] [2022-10-05 08:35:14.056] [               ] Ignoring module 'OpsiPXEConfd', backend 'opsipxeconfd'   (Dispatcher.py:134)
[5] [2022-10-05 08:35:14.264] [               ] Parsing dispatch.conf   (CleanupBackend.py:47)
[5] [2022-10-05 08:35:14.264] [               ] Mysql-backend detected. Trying to cleanup mysql-backend first   (CleanupBackend.py:73)
[5] [2022-10-05 08:35:14.264] [               ] Connection to database 'opsi' on '127.0.0.1' as user 'opsi'   (CleanupBackend.py:238)
[5] [2022-10-05 08:35:14.268] [               ] Cleaning up defaultValues in productProperties   (CleanupBackend.py:244)
[5] [2022-10-05 08:35:14.292] [               ] Cleaning up groups   (CleanupBackend.py:78)
[5] [2022-10-05 08:35:14.294] [               ] Cleaning up products   (CleanupBackend.py:81)
[5] [2022-10-05 08:35:19.144] [               ] Cleaning up product on depots   (CleanupBackend.py:92)
[5] [2022-10-05 08:35:19.147] [               ] Cleaning up product on clients   (CleanupBackend.py:95)
[5] [2022-10-05 08:35:20.301] [               ] Cleaning up product properties   (CleanupBackend.py:98)
[5] [2022-10-05 08:35:20.355] [               ] Cleaning up product property states   (CleanupBackend.py:120)
[5] [2022-10-05 08:35:20.467] [               ] Cleaning up config states   (CleanupBackend.py:215)
[5] [2022-10-05 08:35:20.682] [               ] Cleaning up audit softwares   (CleanupBackend.py:218)
[5] [2022-10-05 08:35:25.842] [               ] Cleaning up audit software on clients   (CleanupBackend.py:221)
[5] [2022-10-05 08:35:26.215] [               ] Renaming config server to 'dssopsi05.domain.xxx'   (Backup.py:329)
[5] [2022-10-05 08:35:26.216] [               ] Ignoring module 'OpsiPXEConfd', backend 'opsipxeconfd'   (Dispatcher.py:134)
[5] [2022-10-05 08:35:26.426] [               ] Creating opsi base   (SQL.py:621)
Danke für eure Hilfe!
gruß Hauke
Antworten