Copy an account and preserve customized DNS settings?

JamesAB

Active Member
Apr 12, 2003
44
0
156
New Hampshire
I have some sites that we are migrating from one cPanel server to a new cPanel server. The site's DNS records have some custom added "A" records.

When I try to copy an account to the new server, the original customized DNS zone is lost and replaced with a new simple version based on the new server's settings.

Both servers are running cPanel 11.24.5

Is there a way to copy an account without loosing the site's DNS zone customizations?

Thanks,
James
 
Last edited:

JamesAB

Active Member
Apr 12, 2003
44
0
156
New Hampshire
Any ideas on how to accomplish this?

I have 30+ sites to migrate and it will be a time consuming hassle if I have to edit the DNS records one-by-one for each site to add the custom "A" records after the sites are transferred.

Thanks for any help or suggestions,
James
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
13
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Provided the customized DNS zones exist on the same server that hosts the cPanel accounts, and not just on standalone DNS servers, they should be preserved when transferring an account using the latest cPanel version (e.g., 11.25). I believe that the difficulty transferring customized DNS entries in cPanel 11.24.x should be resolved by using cPanel 11.25.x with the latest updates applied.
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
If you upgraded both servers to 11.25.x (strongly recommended) then your DNS zone files would be copied over during transfer.

You can also manually transfer the zone files (good for older Cpanel) ....

To do this ....

Transfer the accounts as you normally would and then copy all the *.db files from /var/named on the old server over to the new server.

You will need to do a "sed" or "replace" to replace the old IP addresses with the new IP addresses but that should only take a few seconds to update and then you restart "named" and you are good to go.
 

JamesAB

Active Member
Apr 12, 2003
44
0
156
New Hampshire
The problem for me (while running 11.24) was the fact that both servers were in the same DNS cluster we manage. So once you used WHM to transfer the account, the DNS information would be overwritten on both servers and it did NOT preserve any additional "A" record entries.

To make it work I had to:
  1. Manually backup each site's DNS zone .db file
  2. Transfer the account through WHM.
  3. Edit (the backup copy) of each site's DNS zone .db file to reflect the new IP and increment the serial number to a sensible value.
  4. Use WHM to reload the edited .db files and save them for the changes to take effect.

I used as many shortcuts as I could, but it was still a royal pain. :(

I haven't tried this with 11.25 yet, but I hope it has gotten easier now.
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
The problem for me (while running 11.24) was the fact that both servers were in the same DNS cluster we manage.
If changing out a server in your cluster, you should not put make the new server a part of the cluster until AFTER everything is transferred.

Doing that prior to the transfer will create an enormous amount of added headaches and a lot more work for you that you could skip entirely by just simply waiting to cluster the new server after the transfer is done.
 

JamesAB

Active Member
Apr 12, 2003
44
0
156
New Hampshire
Thanks for the tip.

We tested it both ways and there was no getting around manually fixing the DNS zones in 11.24

I described above what we went through with the servers in the same cluster.

We tested transferring the sites to a standalone server, but that method didn't work out either because the additional "A" records were not transferred to the standalone server's DNS zones. We would have still had to manually modify the zone .db files on the original server to reflect the changes. If I remember correctly the "Change DNS on Source Server to Point to Local Server" option was also flawed because that would cause the original server to erase the DNS "A" records that we were trying to preseve.

So, has anybody tried this in 11.25 yet?