How to migrate cPanel server to another cPanel server

yongki

Registered
Apr 13, 2011
4
0
51
May I Know Step by step to migrate from Cpanel server to another Cpanel server, because we want to change the existing server Cpanel with the new server. I dont want to input one by one database.

Thank you
 

JeffP.

Well-Known Member
Sep 28, 2010
164
15
68
Hi yongki,

To migrate from one cPanel server to another, please do this:

1. Log into WHM as root on the new cPanel server

2. Click "Copy multiple accounts/packages from another server"

3. Fill in the required information and click "Fetch Account List"


You will then be given the option to choose which accounts and packages to transfer.

Please let us know if this helps.

Thanks!
 

yongki

Registered
Apr 13, 2011
4
0
51
Is it same with rsync method ?
And whether the way is done, Can the new cpanel run well like the old cpanel ?
without reconfiguration (Plug and Play), because we do not want to use the old cpanel server.

Thank you
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
What precisely is the rsync method you would be using? The WHM > Transfers area isn't using rsync to perform the copy.

I would not suggest using rsync unless the old server is unstable and you need to quickly get the files off of it before it dies entirely.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Here are some interesting sources:

http://forums.cpanel.net/f49/cpanel-full-backup-98405.html#post445397


/http://blog.eukhost.com/webhosting/restoring-cpanel-server-from-crashed-harddisk-or-migrating-cpanel-servers/


The link(s) above has been disabled, cPanel does not recommend, endorse or support using rsync to transfer files between two servers.
 
Last edited by a moderator:

JaredR.

Well-Known Member
Feb 25, 2010
1,834
24
143
Houston, TX
cPanel Access Level
Root Administrator
As Tristan noted, we do not recommend, endorse or support using rsync to transfer files between two servers. The only situation in which this should be considered would be if the old server is unstable and you absolutely need to move the files quickly. In all other cases, the backup methods that we do support should be used.

Instead of using rsync to copy system configuration files, you can instead copy the cPanel configuration and EasyApache profiles. The following sections of our documentation explain how to do this:

Advanced Options: Pre-Installation
Configuring Apache Pre-Installation

Again, we strongly advise against any method using rsync unless the hard drive in the old server is showing imminent signs of failure. Any other use of rsync can cause more problems than it is intended to solve, because it can and will copy over configurations that will not necessarily work on the new server.
 

postcd

Well-Known Member
Oct 22, 2010
717
19
68
Thanks,

then please what is the full guide to move cpanel accounts and cpanel configuration, apache config and mysql config + any other important things to a new server? I absolutelly dont understand above two links.

The accounts transfer is easy, WHM > Transfers > Copy multiple accounts/packages from another server

But what about easy to follow steps to copy rest of server config?
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
24
143
Houston, TX
cPanel Access Level
Root Administrator
There simply is no simple list of commands that you can copy and paste to "clone" a server or copy an old server's configuration in its entirety to a new one. Copying and pasting rsync commands in an attempt to do this most often causes serious problems, because doing so assumes that the old server's configuration is good and valid. That is a bad assumption to make, and the rsync process will simply copy everything over, bad configurations and all, and cause problems from the beginning on the new server that should be pristine.

The links I provided in my previous post explain how to copy the EasyApache build profile and most of the cPanel configuration. This can be done successfully. If you copy the EasyApache profile and /var/cpanel/cpanel.config and /etc/wwwacct.conf before installing cPanel, cPanel will install using the EasyApache profile and the settings in cpanel.config and wwwacct.conf.

You can copy the MySQL configuration, in most cases, by copying /etc/my.cnf from one server to another. This will only work well if the MySQL version is the same on both servers. If at all possible, it is best to make a MySQL dump, using the mysqldump command, of the databases on the old server, copy the resulting files, then import them into MySQL on the new server. This is far preferable to copying the /var/lib/mysql directory or its contents, which can sometimes work but is not advised.

If you have a hard drive with cPanel installed on it that will not boot, but can be mounted, you can actually use chroot to make that hard drive your environment, and then use cpbackup to make valid, good cPanel backups that way. The only thing this will not do is make backups of the MySQL databases, but you can even work around that by changing the base directory for MySQL in the my.cnf file on the old, bad hard drive. Of course, this does run the risk of copying over bad data if the hard drive has corruption, but it can make good cPanel backups that will restore on the new hard drive.

The best way to avoid all of these less-than-ideal situations, ultimately, is to use cpbackup to make good backups and store them in a remote location, off the server, so that they will be available to restore if the need ever arises. This will completely avoid the need to try to use rsync, chroot, or any other methods to try to salvage data after a hard drive failure or other disaster.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator

dxer

Well-Known Member
Sep 9, 2002
306
0
166
Europe
I am reviving this thread.
I am about to switch servers and I would like to know following:

1. Do I have to set account packages on new server before transfer ?

2. Server nameservers will be set but what about nameservers for the reseller account.....do I have to do something before transfer ? If yes, what exactly

3. Further more on reseller transfer, when transferring all accounts from old server, will reseler's accounts and reseller account itself be transferred and set like it was on old server or do I have to do something after transferring reseller, configuring privileges, etc. ?
 

JeffP.

Well-Known Member
Sep 28, 2010
164
15
68
Hi dxer,

1) No. The accounts can be successfully copied even if you have not created any packages yet on the cPanel server.

2) NS records in the accounts' zones should be populated with the entries at WHM >> Basic cPanel & WHM Setup >> [Nameservers]. So, as long as those nameservers are valid, there's nothing more than needs to be done before the transfer.

3) The reseller structure likely will not be the same on the cPanel server, though I think our migrations scripts developers have been working on that recently. You can always set up an account as a reseller on the cPanel server via WHM >> Reseller Center >> Add Reseller Privileges. You can then use WHM >> Change Ownership of Multiple Accounts to place some accounts under that reseller.

Please let us know if this information is helpful.

Thanks!
 
Last edited:

dxer

Well-Known Member
Sep 9, 2002
306
0
166
Europe
I think second and third questions are not understood correctly so I will explain some more

2. Main server nameservers are set at WHM >> Basic cPanel & WHM Setup >> [Nameservers]. But what about reseller own nameservers, do I have to set them somehow before transfer or transfer will populated reseller how it is on old server. Old server is cPanel/WHM too.

3. Both servers are cPanel/WHM so when transferring accounts with function "Copy multiple accounts/packages from another server" do I have to do anything after transfer or all reseller account will be marked as specific reseller and reseller account will have all privilieges and settings like on previous server ?

Further more, is there any concerns about transferring multiple accounts/packages from another server. I mean I remember when I was doing this 5 years ago, some accounts were not transferred (skipped for some reason) so when I switch on new server and some clients account were not transferred......this was big problem. Can this happen again ?

And this function is called transferring multiple accounts/packages, so will packages be transferred too ?
 

JeffP.

Well-Known Member
Sep 28, 2010
164
15
68
I think second and third questions are not understood correctly so I will explain some more

2. Main server nameservers are set at WHM >> Basic cPanel & WHM Setup >> [Nameservers]. But what about reseller own nameservers, do I have to set them somehow before transfer or transfer will populated reseller how it is on old server. Old server is cPanel/WHM too.

My apologies for misunderstanding. I assumed that you were migrating from a non cPanel server to cPanel, as that is primarily what this section of the forums is intended for. I overlooked the subject line of the thread which states that these are cPanel to cPanel transfer questions.

If you a copy a reseller, their nameserver settings should be copied as well. They are stored in this file:

/var/cpanel/resellers-nameservers

There is nothing to set up on the new server before copying the accounts in regards to the nameservers of the reseller.

3. Both servers are cPanel/WHM so when transferring accounts with function "Copy multiple accounts/packages from another server" do I have to do anything after transfer or all reseller account will be marked as specific reseller and reseller account will have all privilieges and settings like on previous server ?
You should not need to take any extra actions.

Further more, is there any concerns about transferring multiple accounts/packages from another server. I mean I remember when I was doing this 5 years ago, some accounts were not transferred (skipped for some reason) so when I switch on new server and some clients account were not transferred......this was big problem. Can this happen again ?
If there are network connectivity issues between the 2 servers while an account is being copied, that could interfere with 1 or more accounts being copied, yes. I am unaware of any other conditions that would lead to accounts not being copied.

And this function is called transferring multiple accounts/packages, so will packages be transferred too ?
Correct, yes. The necessary package files from /var/cpanel/packages/ will be copied as long as you select them from the "Packages" section found near the top of the page.