CPanel/WHM Move Sites Between Servers

From SuperbHosting.net Support Wiki

Jump to: navigation, search

This method works well for servers up to 200 sites. 24-48 hours before transfer, login to the old server as root and:

cd /var/named && perl -pi.bak -e "s/14400/900/g" *.db
/etc/rc.d/init.d/named restart

Here we have edited every single DNS zone and created a .bak of each (just in case you need to revert). Changing the TTL from 14,400 (24 hours) to 900 (15 minutes) means that as soon as you make a change to a DNS zone, it will take effect everywhere within 15 minutes as opposed to 24 hours. This will be helpful after transfering the account because we want the sites to be pointing to the new server ASAP so that file changes, new emails, etc all get to the new server and don't get "lost". Make sure that you do this however at least 24 hours before starting the transfer, that is how long it will take the internet to "find out" that they need to check the DNS server every 15 minutes instead of 24 hours. (I hope that made sense).

How to transfer:

  1. Login to WHM, click on copy multiple accounts.
  2. Fill out the info.
  3. Select the accounts to transfer, if you choose 'select all' at the bottom, note that you will assign every account its own IP address unless you manually unselect/assign ip addresses to the side of every account.
  4. Sit back and relax.

Transfers have completed, let's make the change happen; login to old server as root:

cd /var/named && perl -pi.bak -e "s/old''ip/new''ip/g" *.db
/etc/rc.d/init.d/named restart

This will point all the sites to the newip. Hopefully most of your sites are on a shared IP. For all of the accounts that are NOT on a shared IP you will need to copy the .db.bak for that domain to .db and edit it to reflect the new IP.

MAKE SURE that you restore the back up file (.db.bak) for the old server's hostname and namesevers, otherwise your DNS will be useless.

Transfer completed. Sites are functioning on new server, now transfer the nameservers!

Here we go: Be sure to set up your NEW nameservers on the NEW server (see setting up nameserver). WHM will only add an A record for the oldips (until you transfer the nameservers with the registrar) so you need to edit the DNS zone to reflect the new ips.

Submit the ip changes to your registrar and give it 48 hours to update. Within 48 hours your DNS will be served off of your new server, thus you can cancel that old server with that host you couldn't wait to leave.

If you have resellers, copy all the files in /var/cpanel that reference resellers and anything ending in .accts to the new server.

Personal tools