« Watching For The Cheap BINs | Home | Transferring Databases - How Do I Transfer A Website? - Part 2 »
How Do I Transfer A Website? - Part 1
By Max | June 8, 2007
I had a good question come up today about the details of transferring a website. Joey wanted to know if I transfer a site to my own server or just assume hosting.
The answer really just depends on the size of the site and the previous owner. Often a webmaster will run several sites on his own dedicated server. This is the most economical way to run several websites. If he is only selling one site out of his network, he will want you to transfer the website to your own hosting plan. If you already have your own hosting plan, and you are purchasing a smaller website, you will probably want to transfer it too, since you’ll be able to run two sites for the price of one.
For a large (requires at least a semi dedicated server) website, if it is possible I would prefer to just assume the hosting costs from the previous owner. Transferring a large site can be a little tricky, and if there is an option to avoid tampering with anything and risk mucking it up, I am going to go with that.
Transferring a site:
There are two things you need to do to transfer a website. First, you have to copy the entire public_html folder and databases where it is currently hosted to your new webhost. Then you have to transfer the domain name and change its Nameserver information to point to yours. The order of these steps is important because you wouldn’t want google to crawl your domain name before you have transferred the data. The GoogleBot will see no data there and will probably drop your search rankings. Since it may take several hours up to a couple days to get all the kinks of the new site worked out, there it a chance the googlebot would visit your empty website during that time. The googlebot really gets around.
Step 1: Copying the data
Typically you can run this command on the old host,
tar cvf entiresite.tar public_html
in the parent directory of the ‘public_html’ folder and that will create a tarfile called entiresite.tar containing all the contents of that folder. Then zip it up and ftp the file to your new host where you will unzip and untar it to the new public_html folder.
To zip it up
gzip entiresite.tar
To unzip and untar it
gunzip entiresite.tar.gz
tar xvf entiresite.tar
The big thing to watch out for here is if tarring the directory results in a file size larger than 2GB. If that is the case, you will need to transfer some of the larger files or subdirectories independently to avoid going over 2GB.
The above steps require ssh access to your webhost. In the absence of ssh access, you could alternatively use WHM or cpanel to assist in a site transfer. Through cpanel on the source host, you will want to go to the “Backups” menu and click “Generate a Full Backup”. Then this file can be ftp’d to the new host where you can use cpanel to Restore from a Backup.
Tomorrow I’ll tackle transferring databases.
Topics: Article |
June 8th, 2007 at 3:51 pm
Max:
Just so you know, you can use
tar -xzvf
to untar and unzip in the same step. As for creating the gzipped tar, I’m sure there is something similar (albeit, I’ve never tried it).
June 8th, 2007 at 5:26 pm
Thanks for answering my question. I am going to print this out and add it to my file. I have read alot about buying sites but I hadn’t found the steps to physicaly accomplish moving the data.
June 8th, 2007 at 11:44 pm
I need to expand this somewhat. If you are familiar with cpanel, performing a backup is probably your best bet.