During backup restore from old foreman-3.12 katello-4.14 server to new foreman-katello server getting error

Problem: I have existing foreman-katello setup (foreman-3.12 Katello-4.14 smart-proxy-3.12) server which is running on RHEL-8.10, I am not able to upgrade foreman-katello on 3.13-4.15 because of OS restriction, I have created new server RHEL-9.7 and installed same version of foreman-3.12 and Katello-4.14 on new server with all required plugins, Then I have created backup on old server and moved to new server and shutdown the old server. Now I have changed hostname and Ip address of new server to old server and restore backup successfully, but after restore backup on new server I have reverted the hostname and ip address to actual IP and hostname of new server and I run command “katello-change-hostname new-foreman --username My_Username --password ‘My_Password’ && foreman-installer --foreman-proxy-foreman-base-url https://<New_server_hostname> --foreman-proxy-trusted-hosts <New_server_hostname> --puppet-server-foreman-url https://<New_server_hostname>“

so I am getting certificate error and smart-proxy still reflecting on old name and all the certificates still showing old server hostname inside /root/ssl-build/

Please guide me how can I migrate my foreman katello environment with all existing data from old server to new server (both server having different IP and hostname). Did i followed right procedure or wrong.

If I was following wrong procedure, please tell me the right procedure.

If I was following right procedure, please tell me where I am making mistake?

Below is the output of both command

katello-change-hostname <new_server_hostname> --username admin --password password

[1] 305110
-bash: V: command not found
The hostname specified must be different from the current hostname. If you have changed the hostname with another utility, please change it back to the original hostname before running this tool.

foreman-installer --foreman-proxy-foreman-base-url https://<new_server_hostname> --foreman-proxy-trusted-hosts <new_server_hostname> --puppet-server-foreman-url <new_server_hostname>

2026-05-14 10:04:21 [NOTICE] [root] Loading installer configuration. This will take some time.
2026-05-14 10:04:25 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2026-05-14 10:04:25 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2026-05-14 10:04:29 [NOTICE] [configure] Starting system configuration.
2026-05-14 10:04:38 [NOTICE] [configure] 250 configuration steps out of 1643 steps complete.
2026-05-14 10:04:39 [NOTICE] [configure] 500 configuration steps out of 1649 steps complete.
2026-05-14 10:04:42 [NOTICE] [configure] 750 configuration steps out of 1652 steps complete.
2026-05-14 10:04:43 [NOTICE] [configure] 1000 configuration steps out of 1657 steps complete.
2026-05-14 10:04:43 [NOTICE] [configure] 1250 configuration steps out of 1659 steps complete.
2026-05-14 10:06:35 [NOTICE] [configure] 1500 configuration steps out of 1659 steps complete.
2026-05-14 10:07:06 [ERROR ] [configure] Exception Failed to open TCP connection to <old_server_hostname>:443 (No route to host - connect(2) for “<old_server_hostname>” port 443) in post request to: https://<Old_server_hostname>/api/v2/hosts/facts
2026-05-14 10:07:06 [ERROR ] [configure] Wrapped exception:
2026-05-14 10:07:06 [ERROR ] [configure] Failed to open TCP connection to <old_server_hostname>:443 (No route to host - connect(2) for “<Old_server_hostname>” port 443)
2026-05-14 10:07:06 [ERROR ] [configure] /Stage[main]/Foreman::Register/Foreman_host[foreman-<new_server_hostname>]/ensure: change from ‘absent’ to ‘present’ failed: Exception Failed to open TCP connection to <Old_server_hostname>:443 (No route to host - connect(2) for “<Old_server_hostname>” port 443) in post request to: https://<Old_server_hostname>/api/v2/hosts/facts
2026-05-14 10:07:37 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_host[foreman-proxy-<Old_server_hostname>]: Could not evaluate: Exception SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch) in get request to: https://<new_server_hostname>/api/v2/hosts?search=name%3D%22<Old_server_hostname>%22
2026-05-14 10:07:37 [ERROR ] [configure] Wrapped exception:
2026-05-14 10:07:37 [ERROR ] [configure] SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch)
2026-05-14 10:07:37 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<Old_server_hostname>]: Could not evaluate: Exception SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch) in get request to: https://<new_server_hostname>/api/v2/smart_proxies?search=name%3D%22<Old_server_hostname>%22
2026-05-14 10:07:37 [ERROR ] [configure] Wrapped exception:
2026-05-14 10:07:37 [ERROR ] [configure] SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch)
2026-05-14 10:07:37 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<Old_server_hostname>]: Failed to call refresh: Exception SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch) in get request to: https://<new_server_hostname>/api/v2/smart_proxies?search=name%3D%22<Old_server_hostname>%22
2026-05-14 10:07:37 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<Old_server_hostname>]: Exception SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch) in get request to: https://<new_server_hostname>/api/v2/smart_proxies?search=name%3D%22<Old_server_hostname>%22
2026-05-14 10:07:37 [ERROR ] [configure] Wrapped exception:
2026-05-14 10:07:37 [ERROR ] [configure] SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch)
2026-05-14 10:07:41 [NOTICE] [configure] System configuration has finished.

Error 1: Puppet Foreman_host resource ‘foreman-<new_server_hostname>’ failed. Logs:
/Stage[main]/Foreman::Register/Foreman_host[foreman-<new_server_hostname>]
Adding autorequire relationship with Anchor[foreman::service]
Adding autorequire relationship with Anchor[foreman::providers::oauth]
Starting to evaluate the resource (1554 of 1659)
Evaluated in 3.06 seconds
Foreman_hostforeman-<new_server_hostname>
Making post request to https://<Old_server_hostname>/api/v2/hosts/facts
/Stage[main]/Foreman::Register/Foreman_host[foreman-<new_server_hostname>]/ensure
change from ‘absent’ to ‘present’ failed: Exception Failed to open TCP connection to <Old_server_hostname>:443 (No route to host - connect(2) for “<Old_server_hostname>” port 443) in post request to: https://<Old_server_hostname>/api/v2/hosts/facts
Error 2: Puppet Foreman_host resource ‘foreman-proxy-<Old_server_hostname>’ failed. Logs:
/Stage[main]/Foreman_proxy::Register/Foreman_host[foreman-proxy-<Old_server_hostname>]
Adding autorequire relationship with Anchor[foreman::service]
Adding autorequire relationship with Anchor[foreman::providers::oauth]
Starting to evaluate the resource (1644 of 1659)
Could not evaluate: Exception SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch) in get request to: https://<new_server_hostname>/api/v2/hosts?search=name%3D%22<Old_server_hostname>%22
Wrapped exception:
SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch)
Evaluated in 0.01 seconds
Foreman_hostforeman-proxy-<Old_server_hostname>
Making get request to https://<new_server_hostname>/api/v2/hosts?search=name%3D%22<Old_server_hostname>%22
Error 3: Puppet Foreman_smartproxy resource ‘<Old_server_hostname>’ failed. Logs:
/Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[<Old_server_hostname>]
Adding autorequire relationship with Anchor[foreman::service]
Adding autorequire relationship with Anchor[foreman::providers::oauth]
Starting to evaluate the resource (1646 of 1659)
Could not evaluate: Exception SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch) in get request to: https://<new_server_hostname>/api/v2/smart_proxies?search=name%3D%22<Old_server_hostname>%22
Wrapped exception:
SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch)
Failed to call refresh: Exception SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch) in get request to: https://<new_server_hostname>/api/v2/smart_proxies?search=name%3D%22<Old_server_hostname>%22
Exception SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch) in get request to: https://<new_server_hostname>/api/v2/smart_proxies?search=name%3D%22<Old_server_hostname>%22
Wrapped exception:
SSL_connect returned=1 errno=0 state=error: certificate verify failed (Hostname mismatch)
Evaluated in 0.02 seconds
Foreman_smartproxy<Old_server_hostname>
Making get request to https://<new_server_hostname>/api/v2/smart_proxies?search=name%3D%22<Old_server_hostname>%22
Making get request to https://<new_server_hostname>/api/v2/smart_proxies?search=name%3D%22<Old_server_hostname>%22

3 errors were detected.
Please address the errors and re-run the installer to ensure the system is properly configured.
Failing to do so is likely to result in broken functionality.

The full log is at /var/log/foreman-installer/katello.log

Expected outcome:

Foreman and Proxy versions: 3.12 & 3.12

Katello versions: 4.14

Foreman and Proxy plugin versions: 3.12

Distribution and version: RHEL-8.10

Other relevant data:

Hi

I have recently ran into a similar issue as well. I had to do a few different things. I can suggest a good first step to be trying to run

foreman-installer --certs-regenerate true
then try and run the katello-change-hostname again.

If this does not work let me know!

Hello @aidenfine

I have tried with given command “foreman-installer --certs-regenerate true“ but no luck.

Also I have noticed “/etc/foreman-installer/scenarios.d/katello-answers.yaml” file contained old server details, If I change it manually it will work, but I don’t know how to do it via foreman-installer command.

Manually changing those old server details was going to be my next suggestion, I was hoping that --certs-regenerate true would solve it.

So to confirm did manually changing things fix the issue of the backup restore error or is there still some issues?

by changing it manually and rerun foreman-installer –certs-update-all will fix the issue.

But manually editing the file and then running the foreman-installer command is not the right way, if this issue occurs without editing the file then using some options with the direct foreman-installer command is the right way to fix issue.

Can you please tell me how exactly steps you followed during migration. if you have 2 different hostname of server i.e. foreman-1 and foreman-2 and creating restoring foreman-1 backup on foreman-2 and you want to replace/update all the detail on restore server (foreman-2) with its hostname in that case what steps we can follow.

Okay so when I did this it was on the downstream project (Satellite) with this project we have a few more tools, GitHub - RedHatSatellite/satellite-clone: Utility to assist cloning an existing Satellite 6 server to a new host · GitHub was the project I was able to use.

I am still working through your issue and documenting my steps, I currently have 2 vms with your exact specs working through to try and fix this issue for you.