Backup / Move a Website I
Moving my website or backing up my entire website is something I do often. If you've never attempted to move or backup your site before you might want to find out if your web host supports SSH / Telnet.
Without it, moving (or restoring from a backup file of) your entire website including webpages, scripts and mysql databases is going to be a nightmare! Also, I am assuming that you're on a *nix / Apache server.
Just to give you an idea, it usually takes me just about 15 minutes to move my website.
SSH Secure Shell login
Login at your old webserver. Once you're in, type
cd public_html
or it could be -
cd htdocs
depending on the structure of your webserver.
Hit Enter and you should be in your WWW root where your web pages reside.
If you want to be certain that you're in the right folder, just type
ls
hit Enter, and you should be able to see all your web pages and folders listed. Once you're certain you're in the right directory / folder, you can proceed to create the backup file of website or tarball (compressed file) of your entire* website.
Create a tarball
Now, you will want to type in a command that will collect all these files and folders, and compress them into one little file - a tarball.
Type
tar -cpzf filename.tar.gz *
hit Enter. Using your domain name as a filename is a good idea, I think. So what I usually do is something like this:
tar -cpzf desilvabiz.tar.gz *
but, the filename you set for yourself COULD be anything!
Within seconds, it should be done and now you can either download this file through your regular browser by just pointing to it; i.e. http://www.desilva.biz/desilvabiz.tar.gz or 'get' it using a regular FTP program from your webserver just like you would any web page, image file or script off your webserver previously.
Since I am trying to move my website, I have no need for this file on my HDD, so I will usually skip downloading it altogether.
Well, how do I get this file to my new webserver? THIS, is the gem of the entire article and it is what I will discuss on the next page. Go to: Part II.
