10 April 2007

6 Steps for Moving Websites

How do I move my web site to another host? - DFRI, and others

If you have a 100% static web site, moving from one host to another is fairly easy. Of course, how often do we get to do things the easy way? Assuming a dynamic web site with some database-housed content (say, a content management system or forum software) there is very particular sequence of events that needs to happen to minimize pain. Some of the steps below only apply to web sites with database-backed content, and can be skipped for sites without it.

Step 1: Set up the new hosting account.

This step is obvious to anyone in the web hosting universe, but is not apartment to others. Moving a web site takes time. If you try and shut down your old service without having a new spot ready, you can wind up in web server limbo. Give your new host 24 hours to get your account set up, and DNS records propagated to their outward-facing DNS servers. Some hosts only update their DNS records once every 12 to 24 hours!

Step 2: Lock your existing web site.

If you aren't the only person updating your web site data, you'll need to lock it temporarily. If something changes after you have copied your data, but before you have finished, you'll have two separate versions of your data! If you don't want to get a stack of e-mails that say “Where did my post go?”, don't skip this step.

Step 3: Copy your data.

All of your files and database data will need to copied to your new web host. This should be fairly easy, so long as you don't forget the incidentals. Be mindful of file permissions, as some files may be created by the web server, and a loss of proper permissions could break your web site. The biggest culprits here are upload directories, uploaded files, and cache files. Consult your original deployment instructions or setup manuals if you are unsure about file permissions. Also, keep a close eye on database host names, database names, user names, and passwords. If any can't be copied exactly, you'll need to note the changes for later.

Step 4: Connect your old web site to your new database.

If you have any dynamic content, you will need to point the code on your old host to the database on your new host. Keep in mind that this is against the terms of service for many web hosts, and not even possible with many. If your new web host won't let you do this, find another one and go back to step 1. If your old web host won't let you do this, well, its a good thing you are moving. A few quick edits to configuration files should be all that is necessary. When you are done, unlock your existing web site, but leave any file uploads disabled. It's OK, all of those edits to the database are happening on your new web host.

Step 5: Connect your new web site to... your new web site.

You've already copied files, now you need to reconfigure your code. Make the same edits to files you did in step 4. Some options may be a little different (localhost vs sql.hostdomain.tld, for example.) Wow, this step was short.

Step 6: Updating DNS information.

The final step is to update your DNS information to point to your new web host. In most cases, this means changing your domain's name servers to the values provided by your new web host. Those with third party DNS hosting (or DNS hosting from the domain registrar) can update the DNS records for the domain. Your new host can provide you with all of the necessary information.

That's it! Your done! It make take up to 72 hours for the switch to be complete, but since you carefully followed the above instructions, it doesn't matter! It will all come together. After you are satisfied that no one is being pointed to the old web host, cancel your old account.

What? You want to move e-mail accounts too... Well, that is a different story...


Anonymous said...

This information is really good and I will say will always be helpful if we try it risk free. So if you can back it up.thanks for sharing here.. hosting service

Sahil Sharma said...

Thanks for sharing 6 steps for moving websites such a useful information.
Web Hosting

Sankriti Malhotra said...

Wireless Earphones with Bluetooth
Bluetooth Headphone for Mobile
15000 mAH Power Bank
Wireless rechargable Bluetooth Headphone
Universal Charging 15600 mAH Power Bank

sakshi sharma said...

This is the immense post you shared here. Individuals constantly befuddled in web facilitating. You depict extremely well about web facilitating.
Leading Digital Marketing Company in Gurgaon