Can not duplicate server

We want to duplicate our server, in order to achieve a staging environment where we can do extreme tests.

I followed this tutorial to change the IP address of the server. Additionally to the tutorial, I added the following steps to change the external URL:

bm.ini: external_url changed
postgresql: adjusted the second command to include external url:

sudo -u postgres -i psql -h localhost -U bj -d bj -W -c "update t_systemconf set configuration = configuration || hstore('host','<new IP>') || hstore('hz-member-address', '<new IP>') || hstore('external-url','<new external URL>');"

When I then start the server again, I get this Keycloak error:

If I press on “Back to Application” I get redirected to the production server.

The keycloak part was missing. Managed to do it in the end with external help.

Modifying IP address and modifying external URL must be done in 2 distinct steps.

The external URL must be change from administration console, not in the database.

Can be done in database too. That was not the problem.