How to change IP address in VestaCP

Hi there, My hosting provider sent me an urgent message that because of a hardware problem they have to change my VPS server to another server. So they’ve migrated the VM clone of my EXSi VPS server to another server with all my current data & CP.
Now the IP address of my server is changed and HestiaCP is not working properly.
Can you tell me How can I change the old IP address to the new IP for fixing everything in HestiaCP?
A Step by step tutorial that will also help other people that may google the same topic in the future.

Haven’t tried yet

But

And then

Make sure to backup / snap shot first…

How to use it? Please give me an example. I don’t know what are the following options:

# options: IP NETMASK [INTERFACE] [USER] [IP_STATUS] [IP_NAME] [NAT_IP]
#

systemctl status nginx.service

● nginx.service - nginx - high performance web server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-09-03 03:37:29 +0430; 9min ago
Docs: nginx documentation
Process: 10746 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)

Sep 03 03:37:29 mypanel systemd[1]: Starting nginx - high performance web server…
Sep 03 03:37:29 mypanel nginx[10746]: nginx: [emerg] bind() to 46.4.0.0:80 failed (99: Cannot assign requested address)
Sep 03 03:37:29 mypanel systemd[1]: nginx.service: Control process exited, code=exited status=1
Sep 03 03:37:29 mypanel systemd[1]: nginx.service: Failed with result ‘exit-code’.
Sep 03 03:37:29 mypanel systemd[1]: Failed to start nginx - high performance web server.

it’s even easier, because there is v-update-sys-ip which should take care of most of the things needed.

eventually you want to also run v-rebuild-web-domains and v-rebuild-mail-domains afterwards to have all configs rewritten properly.

1 Like

Yes I’ve used the same command and now my new IP is detected by HestiaCP, but my current problem is this nginx error:

Do you have anything in /etc/nginx/conf.d/ which references 46.4.0.0?

What is that IP address anyway? Is that meant to be the old IP or the new one? It looks wrong in either case.

1 Like

/etc/nginx/conf.d/ is an empty file!

That is the old- IP

This solution worked for me:

1 Like

if your server is natted and has only the local IP available to bind to, of course this could make sense…

1 Like

I’ve done all this steps… but I have an error message for v-rebuild-mail-domains mydomain:
"/usr/local/hestia/func/domain.sh:line 757 v-list-mail-domain-ssl: command not found
(and same for line 758)

Any idea?

Bug has been resolved in our main branch

But not in

Fix is to replace

v-list-mail-domain-ssl with
$BIN/v-list-mail-domain-ssl