LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Closed Thread
  Search this Thread
Old 09-23-2008, 05:20 AM   #1
eukscott
LQ Newbie
 
Registered: Sep 2008
Posts: 1

Rep: Reputation: 0
Migrating Cpanel Servers


Moving all the accounts between two Servers that host the same control panel is usually not a very difficult process.

You need to move all domains from the present server to the new server. At the same time, you need the whole move done perfectly and with zero downtime for all domains. In addition, you need to move even your nameservers between two different datacenters. Its pretty complicated.
Migration implementation

1. The nameservers and the domains TTL (Time To Live) needs to be reduced to, say between 30 minutes to 1 hour. This change has to be effected at least one week before the IP changes, as it needs time to propogate to the various ISP’s all around the world. This ensures that the fresh zone files are loaded all around the world faster and that they access the old server for a shorter duration.

2. Accounts need to be moved to the new server. All information just prior to the IP changes of the client should not be lost and hence “rsync” is the needed just prior to the move.

3. The change over should have minimum impact in terms of site accesses becoming slow or mails being lost.

4. The new server needs to be setup and properly configured prior to the move and all necessary softwares need to be installed.

5. A study of the top 10 domains that use maximum softwares/resources on the server needs to be done. This way, once the move is done, they are checked to first ensure everything is working like ins the old server.
Nameserver TTL

1. Login to the cpanel WHM,

http://oldserver.com:2086
Username : root
Password : “your password”

1. Then Go to the following link

Main –> Server Configuration –> Basic cPanel/WHM Setup

1. Set Domain Time to Live & Nameserver Time to Live to 3600 seconds and save changes.
Moving Accounts

1. Login to the WHM of the new server and go to

Main –> Transfers –> Copy multiple accounts from another server

1. Enter the old server’s IP address, enter the password and click on “grab account list”
2. This will give you a list of all the accounts on the old server. Select the accounts you need copied over and once completed, initiate the transfer.
3. Once this transfer is completed, (it may take anywhere between 2-12 hours depending on connection speeds, server utilization, size of accounts being moved) only then should you close the window. Any connection breakup would mean you would need to terminate the copy on the new server and reinitiate the transfer again from the one where the connection broke.
4. You will get a status report on all account moves that were successful. Accounts that have a “-” in their username is not accepted in the new cPanel taxonomy, so you would need to manually make changes and copy those accounts over on to the new server.
Rsync

Once the account moves are done, the next thing would be that till the ip changes, nameserver changes are done for the accesses to be directed to the accounts on the new server, we would need to ensure that they are synchronized and no data is lost.

To rsync, follow these steps:

a) Setup ssh-key

b) rsync the folders /home , /var/cpanel , /var/lib/mysql , /usr/local/cpanel/3rdparty/mailman , /usr/local/cpanel/base/frontend , /etc/valiases , /etc/vdomainaliases , /etc/vfilters using the commands

for user in `cat /home/tomove`; do rsync -avuz -e ssh root@OLDSERVERIP:/home/$user/ /home/$user; done

rsync -avuz -e ssh root@OLDserverIP:/var/cpanel /var/cpanel

rsync -avuz -e ssh root@OLDserverIP:/var/lib/mysql /var/lib/mysql

rsync -avuz -e ssh root@OLDserverIP:/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty/mailman

rsync -avuz -e ssh root@OLDserverIP:/usr/local/cpanel/base/frontend /usr/local/cpanel/base/frontend

rsync -avuz -e ssh root@OLDserverIP:/etc/valiases /etc/valiases

rsync -avuz -e ssh root@OLDserverIP:/etc/vdomainaliases /etc/vdomainaliases

rsync -avuz -e ssh root@OLDserverIP:/etc/vfilters /etc/vfilters

Fixing Databases

Once rsync is completed, you need to repair the mysql databases since they get corrupted.

By running /scripts/fixmysql on the new server and verifying if the databases are showing to be ok, you can ensure that there is no corruption in databases. Just run the following commands after going to /var/lib/mysql on the new server

/scripts/fixmysql;/usr/bin/mysql_fix_privilege_tables;/usr/bin/mysqlcheck -A –auto-repair;myisamchk -r -e ./*

Setting up Cron

You can setup Cron scheduler to repeat the rsync every couple of hours till the IP’s on the old server are changed to that of new servers. This ensures minimum loss of data.
Changing IP on the OLD Server

Initially when you move accounts to the new server, you need to ensure they all use the same shared IP and we need to keep a list of the accounts that need unique IP. Once the account moves are completed, do the following steps on the old server:

1. Change the IP the zone files of the DNS on old server to new server.

cd /var/named
perl -pi.bak -e “s/[oldip]/[newip]/g” *.db

1. Next, do these steps:

mv /etc/secondarymx /etc/secondarymx.orig
mv /etc/localdomains /etc/secondarymx
mv /etc/secondarymx.orig /etc/localdomains

This ensures that mails sent locally within the server as well as using forms, also go to the new server instead of being sent to the local mailboxes.

In 24 hours time, if everything is working fine and the accesses are moving to the new server, set the TTL and nameserver TTL on the new server to 14400 and you can shutdown the old server. Also you can change the IP’s of dedicated IP clients to unique IP’s and everything should work fine.

Last edited by XavierP; 09-23-2008 at 11:18 AM.
 
Old 09-23-2008, 07:31 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
What exactly are you doing? (My guess is just advertising that web site.)

Reported
 
Old 09-23-2008, 11:19 AM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Not any more he's not. My guess is that the 3 keywords "moving" "datacenter" and "rsync" mean big money in SEO terms. Anyway, removed links and closed.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Migrating Servers between same distribution but different hardware marcusone Linux - Server 6 06-27-2008 02:55 PM
Cpanel Fredstar Linux - Newbie 5 11-03-2006 10:26 AM
migrating users between 2 linux servers javier_ccs Linux - General 3 09-12-2006 01:21 PM
Migrating domain to my own DNS servers... Erik Thorsson Linux - Networking 1 12-18-2004 03:06 AM
migrating nis servers mkaczm Linux - General 0 04-26-2004 12:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 08:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration