CentOS 6 vm to CentOS 7 vm - advice on migration with hostname/ips

morrow95

Well-Known Member
Oct 8, 2006
164
8
168
I am updating from CentOS 6 to CentOS 7. To do that, I created a second vm, which has a 'temporary' hostname and different ips than the original, as well as a second whm/cpanel license. Both vms are in the same vapp/cloud just use a differnt public ip subset. Here is what I am looking at :

current vm :
server.example.com
100.0.0.3 > 192.168.10.3 (main and ns1.example.com)
100.0.0.4 > 192.168.10.4 (ns2.example.com)

new vm:
server2.example.com
50.0.0.5 > 192.168.10.5 (main)
50.0.0.6 > 192.168.10.7

I know that whenever I am ready to switch the two I can swap the hostname and ips in my cloud quickly and easily. What I would like to know is how I should go about a few thing in WHM right now before I do that swap.

- Should I leave the hostname and ips as they are in WHM until everything is transferred/configured then change the hostname in WHM as a final step after changing them for the vm? If I do that would the ips automatically change in WHM? Or do I go ahead and change the hostname to what it will be later, server.example.com, before doing all this and then when I am finally done the change in my vm will make it 'active'?

- Do I still set ns1.example.com and ns2.example.com as the nameservers in the new vm?

I'm probably not explaining myself well here, but my goal is to configure the second WHM/Cpanel and migrate all the accounts over first and then when I am finally ready switch the hostname/ips in my cloud so they are the exact same as the original... at the same time I would change those on the original to something else. Essentially I would be 'swapping' the vms... the centos6 would become inactive and the new centos7 would become active... same hostname and ips. What I am concerned about is migrating my accounts over, the nameservers, dns zones, and so on right now before I make that change and what is the best way to go about that.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,272
313
Houston
Should I leave the hostname and ips as they are in WHM until everything is transferred/configured then change the hostname in WHM as a final step after changing them for the vm? If I do that would the ips automatically change in WHM? Or do I go ahead and change the hostname to what it will be later, server.example.com, before doing all this and then when I am finally done the change in my vm will make it 'active'?
Yes, until you're sure things are functioning properly on the new server.


The documentation here: How to Move All cPanel Accounts from One Server to Another | cPanel & WHM Documentation goes over transfers from start to finish.

Do I still set ns1.example.com and ns2.example.com as the nameservers in the new vm?
You can set them but you wouldn't be able to change the A records for those until you're certain everything is functioning and you're ready to move DNS to the new server.
 

morrow95

Well-Known Member
Oct 8, 2006
164
8
168
Yes, until you're sure things are functioning properly on the new server.


The documentation here: How to Move All cPanel Accounts from One Server to Another | cPanel & WHM Documentation goes over transfers from start to finish.


You can set them but you wouldn't be able to change the A records for those until you're certain everything is functioning and you're ready to move DNS to the new server.
Thanks for the reply Lauren! So keep the new hostname and ips on it till everything is transferred and setup correctly. After that, what would be the steps to change over to the old hostname and ips as far as WHM/cpanel is concerned? Doing that in my vm takes a few minutes and a reboot, but when it comes to WHM/cpanel my concern is the files I do not know about that have the 'wrong' hostname and ips.

Also, the nameservers are in use because the original vm is still functioning of course till we make the switch. I'm not really going to be able to do a real test in terms of using the domains or anything using them - they will point to the original vm/ips.
 

morrow95

Well-Known Member
Oct 8, 2006
164
8
168
  • You must select a main IP address that differs from your old server.
  • Select the same hostname, shared IP address, and nameservers that your old server uses. The system configures the DNS zone files of restored accounts with those settings. You can do this in WHM’s Basic WebHost Manager Setup interface (WHM >> Home >> Server Configuration >> Basic WebHost Manager Setup).
Just to be clear on this from the link you posted (How to Move All cPanel Accounts from One Server to Another | cPanel & WHM Documentation )...

"The IPv4 address (only one address) to use to set up shared IPv4 virtual hosts.
We strongly recommend that you only specify an IPv4 address that you have associated with this server. " This should be set to the local, not public, ip of the old server? I am in NAT mode and it doesn't specify here, but I assume local?

Nameservers should be set to the old nameservers?

Home » Networking Setup » Change Hostname should be set to the old hostname?

Then I go ahead and start transferring accounts and follow along with the rest of the linked page. Currently at "Home » IP Functions » Show or Delete Current IP Addresses" I am showing the new local/public ip for "Main/shared IP for: nobody and root". At "Home » IP Functions » Show IP Address Usage" I show the same new public ip used for the new hostname.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,272
313
Houston
Hello,

The IP in Basic WebHost Manager Setup should be the public IP

For the rest of those it should be fine but keep in mind the NS and the hostname won't resolve until you point the A records (don't do that until you're ready, it's just a reminder of something to be aware of)
 

morrow95

Well-Known Member
Oct 8, 2006
164
8
168
The IP in Basic WebHost Manager Setup should be the public IP
Even with a NAT setup? It seems pretty much everywhere else in WHM you enter the local ip, but then again those have a little warning box about NAT mode detected. Our vm just has local ips then it is in our edge firewall that we have dnat/snat rules in place to route local/public as needed. I looked at our old WHM setup and it does have the public ip entered for Basic WebHost Manager Setup, but I also remember we had some issues early on with it not resolving ips correctly. That is why I want to be sure on this one before I go any further.

Again, thanks for the response Lauren!
 

morrow95

Well-Known Member
Oct 8, 2006
164
8
168
We got it taken care of although did run into a few issues here and there with ips and hostnames mix matched. Took a little longer than expected, but is good to go now. Thank you!
 
  • Like
Reactions: cPanelLauren

chloedecker2013

Registered
Jul 24, 2020
1
0
1
pakistan
cPanel Access Level
Website Owner
I am updating from CentOS 6 to CentOS 7. To do that, I created a second vm, which has a 'temporary' hostname and different ips than the original, as well as a second whm/cpanel license. Both vms are in the same vapp/cloud just use a differnt public ip subset. Here is what I am looking at :

current vm :
server.example.com
100.0.0.3 > 192.168.10.3 (main and ns1.example.com)
100.0.0.4 > 192.168.10.4 (ns2.example.com)

new vm:
server2.example.com
50.0.0.5 > 192.168.10.5 (main)
50.0.0.6 > 192.168.10.7

I know that whenever I am ready to switch the two I can swap the hostname and ips in my cloud quickly and easily. What I would like to know is how I should go about a few thing in WHM right now before I do that swap.

- Should I leave the hostname and ips as they are in WHM until everything is transferred/configured then change the hostname in WHM as a final step after changing them for the vm? If I do that would the ips automatically change in WHM? Or do I go ahead and change the hostname to what it will be later, server.example.com, before doing all this and then when I am finally done the change in my vm will make it 'active'?

- Do I still set ns1.example.com and ns2.example.com as the nameservers in the new vm?

I'm probably not explaining myself well here, but my goal is to configure the second WHM/Cpanel and migrate all the accounts over first and then when I am finally ready switch the hostname/ips in my cloud best shirt so they are the astroworld exact same as the original... at the same time I would change those on the original to something else. Essentially I would be 'swapping' the vms... the centos6 would become inactive and the new centos7 would become active... same hostname and ips. What I am concerned about is migrating my accounts over, the nameservers, dns zones, and so on right now before I make that change and what is the best way to go about that.
Yes, until you're sure things are functioning properly on the new server.
 

Hazel Daniel

Registered
Nov 7, 2020
1
1
3
United States
cPanel Access Level
Website Owner
Yes, until you're sure things are functioning properly on the new server.
I am updating from CentOS 6 to CentOS 7. To do that, I created a second vm, which has a 'temporary' hostname and different ips than the original, as well as a second whm/cpanel license. Both vms are in the same vapp/cloud just use a differnt public ip subset. Here is what I am looking at :

current vm :
server.example.com
100.0.0.3 > 192.168.10.3 (main and ns1.example.com)
100.0.0.4 > 192.168.10.4 (ns2.example.com)

new vm:
server2.example.com
50.0.0.5 > 192.168.10.5 (main)
50.0.0.6 > 192.168.10.7

I know that whenever I am ready to switch the two I can swap the hostname and ips in my cloud quickly and easily. What I would like to know is how I should go about a few thing in WHM right now before I do that swap.

- Should I leave the hostname and ips as they are in WHM until everything is transferred/configured then change the hostname in WHM as a final step after changing them for the vm? If I do that would the ips automatically change in WHM? Or do I go ahead and change the hostname to what it will be later, server.example.com, before doing all this and then when I am finally done the change in my vm will make it 'active'?

- Do I still set ns1.example.com and ns2.example.com as the nameservers in the new vm?

I'm probably not explaining myself well here, but my goal is to configure the second WHM/Cpanel and migrate all the accounts over first and then when I am finally ready switch the hostname/ips in my cloud loud best shirt so they are the astroworld exact same as the original... at the same time I would change those on the original to something else so they are the exact same as the original... at the same time I would change those on the original to something else. Essentially I would be 'swapping' the vms... the centos6 would become inactive and the new centos7 would become active... same hostname and ips. What I am concerned about is migrating my accounts over, the nameservers, dns zones, and so on right now before I make that change and what is the best way to go about that.
Yes I sure that in a server it works properly and same functioning
 
  • Like
Reactions: cPRex