Page 11 of 22

Re: Migration von i-MSCP zu KeyHelp

Posted: Fri 29. Oct 2021, 11:24
by space2place
So.. Ich habe das Script mit einem neuen Konfigurationsschalter erweitert

Code: Select all

# true or false => true: on i-MSCP is MySQL version >= 5.7 installed
imscpMysqlVersion5_7 = false
Wenn man den auf "false" lässt bekommt man bei der MySQL >= 5.7 eine Fehlermeldung

Code: Select all

A MySQL query Error occurred: It seems on i-MSCP is MySQL version >= 5.7 installed. Set 'imscpMysqlVersion5_7' to true in the migration-config.cfg.
Dann stellt man die Parameter auf true und es läuft wie gewohnt.

Wenn der Parameter auf "true" steht und die i-MSCP MySQL version ist <= 5.7, dann erstellt das Script ein neues Passwort. Deswegen sollte man den Parameter nur ändern wenn das Script das auch meldet. DIe Änderungen gehen gleich Online.

Re: Migration von i-MSCP zu KeyHelp

Posted: Fri 3. Dec 2021, 14:37
by swoop
Hallo,

erstmal, danke fürs erstellen dieserse Scriptes.

Ich wollte es gerade mal ausprobieren, aber ich erhalte die Meldung, dass ich ein selbstsigniertes Zertifikat verwende.

Code: Select all

Starting migration i-MSCP to KeyHelp

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 411, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1123)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='isp.domain.at', port=443): Max retries exceeded with url: /api/v1/server/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1123)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/i-mscp-keyhelp-migration/./i-mscp_keyhelp_migration.py", line 102, in <module>
    responseApi = requests.get(apiUrl + apiEndpointServer + '/', headers=headers, timeout=apiTimeout,
  File "/usr/lib/python3/dist-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='isp.domain.at', port=443): Max retries exceeded with url: /api/v1/server/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1123)')))
Kann ich das zum Testen, nicht einfach umgehen?

Ich bin in der Zertifikatsgeschichte noch nicht so wirklich durch, bin schon froh, dass das der Certbot automatisch macht. ;) :oops:
Die Zertifkiate lasse ich per Let's Encrypt auf einem anderen Server erstellen und hab eine cert.pem, chain.pem, fullcahain.pem und eine privkey.pem.
Ach ja, und ich habe von Let's Encrypt das CA-Zertifikat runtergeholt.
Wäre toll wenn mir jemand sagen könnte, wo ich nun welche pem Datei im KeyHelper eintrage? Ich find das verwirrend.

Danke für eure Hilfe und nochmal, ein tolles Script.

SG

Re: Migration von i-MSCP zu KeyHelp

Posted: Fri 3. Dec 2021, 14:47
by swoop
Hallo Nochmal,

OK, das mit dem Zertifikat in KeyHelper reinzubringen hab ich jetzt rausgefunden. War ja doch nicht ganz so schwierig als ich zuerst gedacht hab.
:oops: :oops: :lol: :lol:

SG

Re: Migration von i-MSCP zu KeyHelp

Posted: Fri 3. Dec 2021, 18:46
by swoop
Hallo,

so, jetzt hab ich es mit funktionierendem Zertifkat nochmal versucht, aber folgende Meldungen erhalten. Daraus kann ich mir aber leider keinen Reim machen.

Code: Select all

Starting migration i-MSCP to KeyHelp

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 411, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/usr/lib/python3/dist-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='isp.domain.at', port=443): Max retries exceeded with url: /api/v1/server/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/i-mscp-keyhelp-migration/./i-mscp_keyhelp_migration.py", line 102, in <module>
    responseApi = requests.get(apiUrl + apiEndpointServer + '/', headers=headers, timeout=apiTimeout,
  File "/usr/lib/python3/dist-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='isp.domain.at', port=443): Max retries exceeded with url: /api/v1/server/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))
Meine I-MSCP Installation (i-MSCP 1.5.3, Build: 2018120800) is auf einem Debian 9 installiert.

Kann mir bitte jemand sagen, was ich da vergessen habe oder falsch mache?

SG

Re: Migration von i-MSCP zu KeyHelp

Posted: Fri 3. Dec 2021, 18:48
by space2place
Keine Ahnung was Du da treibst, aber wenn Du kein gültiges Zertifikat für KeyHelp hast, einfach in der „migration-config.cfg“

Code: Select all

apiServerFqdnVerify = False
Setzen

Re: Migration von i-MSCP zu KeyHelp

Posted: Fri 3. Dec 2021, 19:15
by swoop
Hallo space2place,

vielen Dank, für deine schnelle Hilfe.

Die Option habe ich total übersehen.

Jetzt läuft die Migration mal und ich schaue was das nun kommt.

Danke nochmal für das tolle Script, erleichter vieles.

SG

Re: Migration von i-MSCP zu KeyHelp

Posted: Fri 3. Dec 2021, 22:13
by swoop
Hallo,

die Migration hat soweit funktioniert.
Ist einfach und unkompliziert gewesen.
Leider sind die DNS-Einträge, die ich am alten Server händisch eingetragen habe wurden nicht übernommen.

Ich vermute, dass das nichts mit dem Micgationsscript zu tun hat, aber einigen WP-Sites funktioniert teilweise nicht. Da muss ich wohl händisch nacharbeiten.

Danke

SG

Re: Migration von i-MSCP zu KeyHelp

Posted: Fri 3. Dec 2021, 22:30
by space2place
DNS ist nicht implementiert..
Und die Webseiten muss man nachbearbeiten. Alleine schon die Datenbank Zugänge passen nicht mehr.
Woher soll das Skript wissen welches CMS installiert ist? Es könnten ja auch eigen programmierte Webseiten sein.
Auch ist immer die Standard PHP Version aktiv. Kann ja sein das das CMS nicht mit der neusten PHP arbeitet.
Somit muss man immer etwas nacharbeiten!

Re: Migration von i-MSCP zu KeyHelp

Posted: Fri 10. Dec 2021, 20:17
by swoop
Hallo,

danke nochmal für das tolle script.

mir ist aufgefallen, dass wenn ein Benutzer im iMSPC mehrere Domänen hat, werden zwar im KeyHelper alle Domains angelegt, aber die Bind-Zonendateien werden nicht bei jeder der Domains erstellt.
In der Web-GUI sind alle Domänen usw. vorhanden.

Ich habe nun in einer nichtvorhanden Domäne einfach einen eintrag hinzugefügt, dann gespeichert und schon war sie da.
leider hilft nicht einfach nur speichern.

ist zwar kein Problem wenn es nur ein paar Domänen betrifft, aber in meinem Fall waren es doch einige die ich nachbearbeiten musste. War aber auch kein Problem. Dafür wurde alles andere übernommen, soweit ich bis jetzt geschaut habe.

SG

Re: Migration von i-MSCP zu KeyHelp

Posted: Thu 16. Dec 2021, 01:51
by akong77
Hello,
I got error message.
Error: File "/etc/keyhelp/config/config.json" does not exist.
How to fix it?

Re: Migration von i-MSCP zu KeyHelp

Posted: Thu 16. Dec 2021, 07:44
by space2place
akong77 wrote: Thu 16. Dec 2021, 01:51 Hello,
I got error message.
Error: File "/etc/keyhelp/config/config.json" does not exist.
How to fix it?
Install KeyHelp at first!
I'd no informations about a change of this directory.

Re: Migration von i-MSCP zu KeyHelp

Posted: Thu 16. Dec 2021, 08:45
by akong77
Hello,
I has already install keyhelp in another server.The migration-config.cfg also setup keyhelp server FQDN. I can ping keyhelp server from imscp server.

Re: Migration von i-MSCP zu KeyHelp

Posted: Thu 16. Dec 2021, 09:49
by Tobi
The script must run on the KeyHelp server.

Re: Migration von i-MSCP zu KeyHelp

Posted: Thu 16. Dec 2021, 09:55
by space2place
akong77 wrote: Thu 16. Dec 2021, 08:45 Hello,
I has already install keyhelp in another server.The migration-config.cfg also setup keyhelp server FQDN. I can ping keyhelp server from imscp server.
:roll: :roll: :roll: :roll:
Requirements
run the script on the KeyHelp server
min. phython 3.5
i-MSCP server must have the version 1.5.3
I think you didn't read nothing on GitHub.

Re: Migration von i-MSCP zu KeyHelp

Posted: Thu 16. Dec 2021, 10:18
by akong77
Sorry,I test it.