How to Move a cpanel/WHM Server?

bidware

Active Member
Sep 2, 2005
31
0
156
Is there a program available (or set of commands) that would allow me to move my entire server to another cpanel / WHM server? I've done customization and there are certain configuration settings that I don't want to have to remember to setup on the new server, etc. So, there must be a program to move the server, say via ftp or something similar?

Thank you.
 
Last edited:

bidware

Active Member
Sep 2, 2005
31
0
156
Ok. That script should work with moving the server. But, there might be one more problem to consider. Once you move the files to the new server, then set the DNS servers (ns1, ns2) to the new IP's of the new server, there will be a 12 to 72 hour period that the DNS takes to propagate. So, during that time, the old server will still be receiving the updates for the 12 to 72 hour period. So, when the DNS finally resolves to the New Server, the New server will not have the current version of the files. Is there any way to ensure that the New server is actually up to date when the DNS does resolve?

Thanks.
 

rsaylor

Well-Known Member
Mar 27, 2003
160
1
168
The answer is to update the zone files on the old server after the account have been moved.

Do a search on perl -pi

This is a search and replace, old IP to new IP
 

bidware

Active Member
Sep 2, 2005
31
0
156
Thanks for that. So, you would run perl -pi on the new server, right after accounts have been moved and ns1, ns2 have been changed?
 

bidware

Active Member
Sep 2, 2005
31
0
156
Would you just do the search and replace on the New server or the Old server? I wasn't sure about that.

Thanks
 

rsaylor

Well-Known Member
Mar 27, 2003
160
1
168
you would run the pearl -pi on the old server so basically you are changing the old ip to the new ip in every zone file. Then restart named. All sites are instrantly resolving to the new server. Now, people who recently visited the sites would have to flush there DNS before it updates for them.
 

bidware

Active Member
Sep 2, 2005
31
0
156
Thanks for that. On the new server, would I still have to run the wizard that appears when you login to whm for the first time?
 

bidware

Active Member
Sep 2, 2005
31
0
156
So how would the users Flush their DNS? They wouldn't necessarily know what that means.
 

nickp666

Well-Known Member
Jan 28, 2005
769
2
168
/dev/null
FOR WINDOWS:

ipconfig /flushdns

from the command prompt if they arent using an internal DNS server (sometimes needs a few goes to work)

If they are running windows server with DNS, go into administrative tools > dns, right click on the server name and choose 'Clear Cache' then run the above a couple of times on the server as well
 

bidware

Active Member
Sep 2, 2005
31
0
156
Ok. Would the script mentioned also transfer all installed programs (for example zend optimizer, current PHP settings, etc. etc.)?

Thanks.
 

bidware

Active Member
Sep 2, 2005
31
0
156
Ok. Thanks. Does that script also change the IP's for all the files copied over to the New server's IP's? I was thinking that cpanel's copy accounts function would be easier to use. Then after copying accounts, configure PHP, and install zend, etc. That would still work the same, or is there still more that I'm missing?
 

bidware

Active Member
Sep 2, 2005
31
0
156
Also, in WHM, can you view the current PHP settings somewhere? I noticed that in Apache Update, It simply shows the default settings, and not necessarily the current ones.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
31
473
Go on, have a guess
You can actually copy them over with the file in /etc/buildapache/config.pl

The script doesn't change the IP's, you'd need to use the WHM > IP Migration Wizard for that.