Skip to Store Area:

Careers
Toll Free: 1800-383-5193
no-image
August 13th, 2012

How to migrate your domain with zero down time and data loss

by bob,
Guru

I have come across several domain migration issues in Web hosting industry. The common issues are the high down time of around 12 - 48 hours experienced while domain transfer and also the data lost during the migration process. In this article I am focusing on how to achieve domain migration with zero down time and also to avoid the data loss. The article is valid for domains hosted under cPanel Linux servers.

Following are the pre-migration checks that are to be performed:

# Connectivity of both the servers
Make sure that both the servers can be connected via SSH, also public keys of the servers are added each other.

#Compatibility of application’s version and modules installed
All the applications and modules installed in the destination server should be compatible with the source server.

#Reseller account and addon domain
Check whether the domain chosen for migration is an addon domain or a reseller account.

#Dedicated IP
Make sure that the dedicated IP is available in the destination server.

#SSL certificate
Copy the SSL certificate, if it is being used by the site.

Steps for domain migration:



1. Reduce the TTL value

The major problem that you might face in domain migration is the DNS caching problem. When a remote DNS resolver will make a query to one authoritative DNS server and if the query is successful it will cache that response for a predefined time. This time is so called TTL value. This means that for that amount of time the particular server will use its cached information and no longer query the authoritative server for any additional requests.

In order to avoid this problem, bring down the TTL value to 150 seconds and reload rndc, 24 hours prior to migration. This can be done by changing the TTL value in the zone file of the domain. If the domain has addon domains, make sure that the TTL values in their zone files are also brought down. Thus zero down time can be achieved instead of a high value of 24 - 48 hours.


2. Migrate the domain to the new server

Migrate the domain using the option “copy multiple accounts/packages from another server” in WHM. Use express transfer option which automatically changes the nameservers and IP address to the new server, so that, even if the query goes to the old server, it will be redirected to the new server.


3. Re-sync the databases, mails and contents of the website

To make sure that zero data loss is achieved in data transfer, re-sync the databases and mails. If the website is dynamic, open tables will be present, so there are chances for the data to get corrupted. In order to avoid this situation, contents of the site and databases are synced.


4. Make sure that the website is loading well

Make sure that the website is loading well and the mails are received correctly.


5. Remove the redirection links in the .htaccess file

Remember to remove the redirection links in the .htaccess file of the new server, that is used to redirect to the new server from the old server.


6.After migration, change the IP address for the nameservers

After domain migration, change the nameservers for the domain to that of the new server once the domain starts digging from the new server. Otherwise the domain will depend on two servers for serving. You can again increase the TTL value of the site to the original value after everything is propogating from the new IP.

The above is a very rough outline on domain migration with zero down time and zero data loss . If you have any questions, we would be happy to talk to you! :)


About the Author :

Greeshma S Giri works as a Jr.Software Engineer in Bobcares. She joined Bobcares in May 2012. She loves reading books and listening to music in her free time.


Post to Twitter Post to Facebook Post to MySpace




no-image
July 12th, 2012

Server migration with ZERO downtime

by arundhati.r,
Wannabe

This is an article that helps you to perform a server migration with zero downtime for the sites. This is applicable for cPanel linux servers. Important things that should be checked before doing a server migration are:


Pre Migration checklist


#Connectivity issue of both servers
This includes the SSH port, wheel user configuration, authentication type, public keys, allow and deny lists, allow users etc.

# Compatibility of application versions and enabled modules
The compatibility of PHP/MySQL versions, PHP modules and type, MySQL conf, Apache version, etc. should be checked

# Disks and the partitions in the new server
Number of partitions and disk availability comparison, RAID configurations, secondary disks, mount options are checked in this step.

# IP address availability in new server
Number of used IP addresses ( including the nameservers, gateway, broadcast, host, dedicated IP address ) in the new server are checked.

Once you have made sure about the above configurations, you can start with the steps to perform the ‘zero downtime migration’. Below are the steps that you should follow.
(** Note: If you are doing the syncing process using a script, then copying the public_key to the server will help you in saving time from entering the user password each time)


Migration checklist


1. Reducing the TTL value for the domains and the nameservers
Reduce the TTL value for the zone files to a value 300 or 150 using a script and then reload rndc to update the changes. This is done to switch back the accounts to the old server if you find any issues in the new server. If the TTL value is not reduced, then it can cause a downtime which will be equal to the TTL value in seconds while switching back the accounts. Below is a sample script to change the TTL for the zone files.

for i in $(find /var/named/ -maxdepth 1 -type f -iname “*.db”); do sed -i -r ’s/$TTL [0-9]{3,5}/$TTL 300/g’ /var/named/$i ; done


2. Checking and making the list of domains that are resolving to any external servers
This is to check and confirm the domain status in the new server.

3. Doing the migration of the accounts to the new server
Using the option “Copy multiple accounts/packages from another server” in WHM, migrate accounts from the old server to new server. Migrating all the accounts at a time is not recommended. Connection loss issues can cause skiping of accounts. Migrating 10 to 20 accounts at a time is recommended. Collect the account usernames that are migrated successfully to the new server. This can be used for re-syncing data after A record change.

4. Change the A record for the domains in the old server to that of the new server
Change the A record for the migrated sites including the add-on domains/parked domains to that of the new server. You can use script to do this. A sample script that will help in changing the IP is as below.
A script to get all the domains including the main domains, add-on domains and parked domains.

while read i; do dom=$(grep $i /etc/trueuserdomains | cut -f1 -d:); grep $i /etc/userdomains | awk -F: ‘{print $1}’ | egrep -v “^.+.$dom”; done /tmp/migratettl


A script to change the IP from 0.0.0.0 to 2.2.2.2 for all the domains.

while read i; do sed -i -r ’s/0.0.0.0/2.2.2.2/g’ /var/named/$i.db; done


5. After the propagation of the TTL, re-sync the databases, mails and site contents to the new server
Do the re-syncing of mails, site contents and databases to the new server. This is done to ensure 100% of data is transferred to the new server. All the updates/changes made after the migration process till the A record change will be synced to the new server. Before database is synced, make sure that you have suspended the account or stopped the mysql service in the old server. This is because we are re-syncing the “/var/lib/mysql/$username_db/” folder. If the mysql access is not ceased, then it can create incomplete tables in the new server. Sample scripts to do this is given below.
A script to re-sync all the updates including the mails and the files. “/tmp/migrate” file should contain the migrated usernames.

while read x; do rsync -rave”ssh -l root -p $PORT” /home/$x/ $REMOTE_SERVER:/home/$x/ ;done


A script to collect the databases and then sync the contents.

for i in $(cat /tmp/migrateuser); do ls /var/lib/mysql/ | grep $i | cut -f1 -d/ ;done >/tmp/migratedatabase
while read d; do rsync -rave”ssh -l root -p $PORT” /var/lib/mysql/$d/ $REMOTE_SERVER:/var/lib/mysql/$d/ ; done


6. Make sure the sites and mails are working fine
Make sure that the re-synced sites and mails are working fine. You can check the apache access logs, mail logs, apache error logs, etc.. to make sure this. Also, dig the domain to see if the domain is loading from the new server or not.

7. Update the license for software like WHMCS, kayako etc. with the new IP address
Software like WHMCS, kayako etc.. have their license set with the IP address of the server where the domain is hosted. If any such software is present in the server, make sure you have updated the software license in the new server with the new IP address. Most of such software has its portal to do this.

8. Create the zone files for the same nameservers with the new IP in new server with reduced TTL value
Create the zone files for the nameservers in the new server with the new set of IP’s. Once it is created, reduce the TTL to 300 or below and reload the rndc. For cPanel, use the below script to add the dns for the nameservers. Instead of $DOMAIN, use the nameserver name.

/scripts/adddns –domain $DOMAIN –ip $IP


9. Change the IP address in the old server for the nameservers to that of the new server
When all the accounts are migrated and re-synced. Change the A record for the nameservers to that of the new set and check if the nameservers are resolving to the new IP. Also, confirm that the new server’s named is receiving and acknowledging the requests.

10. After resolving, change the IP address for the nameservers from domain management
When you are sure that the nameservers are working fine and the new server performances are good enough, do the IP address change for the nameservers from the domain management (registrar level). Note that this will take 24 hours to get propagated. So, do not make this change if you have any confusion with the status of the new server.

11. Switch-off the services in the old server after making sure the log update
Once all the migration is done and made sure that the sites are fine. Switch-off the services except the named in the old server. Named should not be stopped because there are possibilities for handling the requests by the old server.

12. Double check the account list in both and make sure the migration is done for all the accounts
Once this is done, double check the number of accounts in both the servers. This is to find if there are any accounts created in the old server after the migration. If there are accounts like that, migrate those to the new server and re-sync the data.


The above is a very rough outline of the Data Migration service we provide, and if you have any questions, we would be happy to talk to you! :)


About the Author :

Sambhu PS works as a Software Engineer in Bobcares. He joined Bobcares back in February 2011. He loves reading technical blogs, plays violin plays, table tennis and listens to music in his free time.



Blog edited by :

Kumar K works as a Junior Software Engineer in Bobcares. He joined Bobcares back in February 2012. He loves reading books, watching movies and listening music in his free time.




Post to Twitter Post to Facebook Post to MySpace




no-image
March 31st, 2011

Panel less migrations

March 31st, 2011

As we all know, server migration is the process of moving websites hosted on legacy systems to more robust and feature-rich systems. In most cases both the source and destination servers are installed with some control panels and many of these control panels provide tools in order to do this migration automatically. But there are times when we come across situations where both the source and destination servers are not installed with any control panels. Hmm, getting worried? No fear. I’ll guide you through this process and it will be as easy as breeze (well, literally!). Read the rest of this entry »

Post to Twitter Post to Facebook Post to MySpace




no-image
January 5th, 2011

My experience with SmarterMail

by haripriya.cv,
Newbie

Last week, I had the privilege of migrating accounts and emails from Smartermail5.x off a Windows 2005 server to Smartermail7.x in a Windows 2008 server. I had very little experience with Smartermail and felt challenged, when I was assigned the task. Started the migration, and it seemed effortless and fairly simple. It was just a matter of copying files and folders from one server to the other. Much of the task was simplified, since I referred to a well written How To here

Even though the migration went on fine, I did face one major issue. None of the SMTP, POP or IMAP ports were accepting any connections and the result was ‘no service at all’. At first, I thought it was a firewall issue. I configured rules to allow all the needed ports in the server firewall, but the issue stayed. Finally, I could see that the service was still binding to the old servers’ IP address. This has to be manually edited in the mailconfig.xml file and once the change was made, a restart of the smartermail service did the trick.

Read the rest of this entry »

Post to Twitter Post to Facebook Post to MySpace




no-image
July 9th, 2010

Moving on to Cloud

by Sankar H, Senior Software Engineer, Bobcares.
Guru

In today’s economy, Cloud Computing offers the much needed edge and results, for many enterprises. Market as such has given way to more and more players and competitive pricing, which drives in more, to the world of Cloud computing.

The option of Cloud is enticing, since the cost involved is usually low, and it envisages best use of resources, with added flexibility and scalability when compared to conventional computing environments.

Read the rest of this entry »

Post to Twitter Post to Facebook Post to MySpace




no-image
February 10th, 2006

Control panels and migration

February 10th, 2006
Evangelist

1. Webhosting

Web hosting is the business of providing the storage, connectivity, and services necessary to server for a website.

When people choose a host for their website, they are entrusting their data, their domain name and their accessibility of the site to the host. In other words, they are putting their livelihood in the hands of the host.

The web hosts attracts their customers to business by providing attractive and user friendly interfaces for administering the web sites. These interfaces called control panels, makes the site management easier for website managers of all levels of technical sophistication.
Read the rest of this entry »

Post to Twitter Post to Facebook Post to MySpace




Newsletter Sign-up