Solved Move to new server

ericosman

Verified User
Joined
Nov 25, 2019
Messages
481
Location
Weert
Hi,

I’m wanting to change servers, now i’m running a VPS at a dutch company (CentOS 7 inside of a OpenVZ container.)
4GB RAM
200GB
2 ip’s (ipv4)
8 user’s
35 domains

I’m wanting to move to Contabo
AlmaLinux
Directadmin Lite License
30GB RAM
800GB SSD

What are the steps that i have to follow so my clients will not notice anything? Al off my clients use Let’s encrypt SSL certs.

It’s important that there is no mail lost in this process.

Any thoughts? :)
 
Last edited:
Setup your DA server on Contabo first, if needed, aks a temp license and after everything is working correctly, change it to your own license.

For best movement, try to keep everything the same version like the setup of php and mysql/mariadb.
Configure your server.
Set your nameservers to a low TTL.

Then there are 2 ways, this is like I do it:
Stop Exim service via DA (so no new mail can come in)
Change nameversers to new ip's.
Make admin backups
transfer to the new server
restore everything (admins first, then resellers and users last).
Ready.
Mail is not lost because incoming mail gets not accepted (Exim not working) but MX can be found so normally the sending MTA will try to deliver the mail again several hours later, which will be at your new server then if all is correct, because the MX is pointing to that later on.

Another way is to (if I recall correctly):
Make admin backups
restore to new server
change nameservers to new ip
rsync all mail folders to new server.

I don't remember if that is exact the correct way. If I'm not mistaken @Active8 or somebody else had shown the idea to rsync the mail folders to keep loss to a minimum.
It can be found somewhere on the forums, I thought even the account backup was done a bit different, but again, I'm not sure anymore so please correct me if I'm wrong.
 
I literally just did the same thing yesterday. Moved from CentOS 6 (32Bit) to a Contabo AlmaLinux 8.5 (64 Bit) VPS.
8 accounts, 7 domains. I (mostly) used the second method Richard G listed.

FYI All of your LetsEncrypt SSL certs will move from server to server with no issues.

- Spun up new server.
- Updated server (dnf update)
- Installed DA with new license. (I have a Lifetime License, so they would not give me a temp license. You may be able to get a temp license if you are currently paying for a license.
- Hardened server (Locking down SSH, CSF/LFD, etc)
- Performed Admin Backup on Old Server.
- Performed Admin Restore on New Server.
- Checked to ensure no errors/issues. Reviewed Logs, tested sites, email, etc. If you want to "test" sites without DNS changing yet, you can change your Windows HOSTS file to make "domain.com" reflect whatever your new IPs are. I did this to ensure that moving from PHP 5.6 to PHP 7.4 didn't break one of my sites (It did). Just don't forget to remove the entries from the HOSTS file when you are done.
- Went line by line through DirectAdmin configs/control panel between the two servers to make sure everything was identical.
- Stop EXIM on old server.
- Perform another backup of just E-mail Accounts/Data via DA.
- Perform restore of E-mail Accounts/Data via DA.
- Change NameServers to new IPs.
- Waited an hour or so and everything was flowing just fine.
- It's been 24+ hours and everything seems to be working just fine. No one really even noticed anything had happened.

Be patient and methodical and it really ended up being much easier than I thought, even upgrading from old versions of PHP/MYSQL didn't break as much as I anticipated.
 
even upgrading from old versions of PHP/MYSQL didn't break as much as I anticipated.
That depends a bit on the versions used and the scripts used and amount of customers on the server. It can break things when you have customers which have older scripts. Hence my advise to keep php and mysql the same (at least in the beginning) so you can be sure everything will work.
This saves time too look into other issues if they would arise. Mostly all will go fine but one never knows.
 
I've got the big part running (without domains on the new server) the only problem i have it NGINX (apache) isn't running :
Code:
[root@srv1 ~]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/etc/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2022-02-07 19:27:16 CET; 7s ago
  Process: 62095 ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)

Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM systemd[1]: Starting The nginx HTTP and reverse proxy server...
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM nginx[62095]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM nginx[62095]: nginx: [emerg] bind() to [::1]:80 failed (99: Cannot assign requested address)
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM nginx[62095]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM systemd[1]: nginx.service: Failed with result 'exit-code'.
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
[root@srv1 ~]# journalctl -xe
-- Support: https://access.redhat.com/support
--
-- The unit nginx.service has entered the 'failed' state with result 'exit-code'.
Feb 07 19:27:07 SERVERDOMAIN.DOMAIL.COM systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit nginx.service has failed.
--
-- The result is failed.
Feb 07 19:27:13 SERVERDOMAIN.DOMAIL.COM systemd[1]: Starting The nginx HTTP and reverse proxy server...
-- Subject: Unit nginx.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit nginx.service has begun starting up.
Feb 07 19:27:13 SERVERDOMAIN.DOMAIL.COM nginx[62064]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Feb 07 19:27:13 SERVERDOMAIN.DOMAIL.COM nginx[62064]: nginx: [emerg] bind() to [::1]:80 failed (99: Cannot assign requested address)
Feb 07 19:27:13 SERVERDOMAIN.DOMAIL.COM nginx[62064]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 07 19:27:13 SERVERDOMAIN.DOMAIL.COM systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 07 19:27:13 SERVERDOMAIN.DOMAIL.COM systemd[1]: nginx.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit nginx.service has entered the 'failed' state with result 'exit-code'.
Feb 07 19:27:13 SERVERDOMAIN.DOMAIL.COM systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit nginx.service has failed.
--
-- The result is failed.
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM systemd[1]: Starting The nginx HTTP and reverse proxy server...
-- Subject: Unit nginx.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit nginx.service has begun starting up.
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM nginx[62095]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM nginx[62095]: nginx: [emerg] bind() to [::1]:80 failed (99: Cannot assign requested address)
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM nginx[62095]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM systemd[1]: nginx.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit nginx.service has entered the 'failed' state with result 'exit-code'.
Feb 07 19:27:16 SERVERDOMAIN.DOMAIL.COM systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit nginx.service has failed.
--
-- The result is failed.
Feb 07 19:27:25 SERVERDOMAIN.DOMAIL.COM kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:50:56:45:20:87:74:83:ef:4e:ae:4b:08:00 SRC=IDKIP? DST= 2ND IP OF SERVER LEN=40 TOS=0x00 PREC=0x00 TTL=248 ID=58>
Feb 07 19:27:29 SERVERDOMAIN.DOMAIL.COM kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:50:56:45:20:87:74:83:ef:4e:ae:4b:08:00 SRC=IDKIP? DST=1ST IP OF SERVER LEN=40 TOS=0x00 PREC=0x00 TTL=247 ID=457>
Feb 07 19:27:30 SERVERDOMAIN.DOMAIL.COM kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:50:56:45:20:87:74:83:ef:4e:ae:4b:08:00 SRC=IDKIP? DST=2ND IP OF SERVER LEN=40 TOS=0x00 PREC=0x00 TTL=247 ID=812>
lines 2392-2453/2453 (END)

Just tryed

/usr/local/directadmin/scripts/ipswap.sh 1ST IP OF SERVER


But no succes
 
Feb 07 19:27:13 SERVERDOMAIN.DOMAIL.COM nginx[62064]: nginx: [emerg] bind() to [::1]:80 failed (99: Cannot assign requested address)
check your assigned IP in panel then
Code:
cd /usr/local/directadmin/custombuild
./build update
./build update_da
./build set webserver nginx_apache
./build nginx_apache
./build rewrite_confs
 
@Active8

Just checked my ip's :


And after building it show's this :
Code:
make[1]: Leaving directory '/usr/local/directadmin/custombuild/nginx-1.21.4'
Enabling nginx in systemd...
Using 38.242.203.IP1 for your server IP
Using 38.242.203.IP1 for your server IP
Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using 38.242.203.IP1 for your server IP
Restarting nginx.
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

 
Last edited:
There are 2 server still yes?
Server A Has a Ip an license
Server B Has its own IP and License

You added the New server IP to a New License or a temp one?
In the directadmin portal the old server has its license and the new server has its licence?
You cant share anymore. The system wont work without a license. There is no 30 day lag it is realtime.

If that is all good in the Portal.
Just checked my ip's :
I think he means here https://directadmin.com/ customer portal
 
There are 2 server still yes?
Server A Has a Ip an license
Server B Has its own IP and License

You added the New server IP to a New License or a temp one?
In the directadmin portal the old server has its license and the new server has its licence?
You cant share anymore. The system wont work without a license. There is no 30 day lag it is realtime.

If that is all good in the Portal.

I think he means here https://directadmin.com/ customer portal
Server one is still up and running (nothing changed there)
Server 2 is where my issue's are now. It's running on a temp license. ones it's up and running i'm moving everything and i'll buy a new license. (server 1 came with the license from the provider)


IP1 is showing at directadmin.com
 
Isn't the first ip having an odd subnetmask? It says /20. That is not a good subnetmask notation. At least not for a single ip anyway.
Try changing that to a normal subnetmask like 255.255.255.255 or 255.255.240.0 like your second ip. Maybe this is what's causing issues.
 
It's good to have somebody who is known with nGinx, because I don't. :)

However... still think you should change the /20 to correct subnet to have everything in good order, before you run into odd issues in the future.
 
I am moving from Centos 6 to Contabo shortly. This thread is very useful. My DirectAdmin panel stopped working quite recently as Centos 6 is now vintage :)
 
Back
Top