|
Page 4 of 4
Backing it up
In a nutshell: The easiest way to backup your site is by compressing all your HTML/PHP/etc. files, and then downloading the compressed files. Here's how to do it:
Step 1: Get shell access to your account. If you don't have one, ask your web hosting provider nicely :) For security reasons, this is usually disabled by default.
A shell allows you to access your server thru a command-line interface (think DOS). With shell access, you can FTP, debug CGI scripts, set permissions, and even read your email.
If your web hosting provider refuses to grant you an SSH/Telnet access, you have no choice but to download each of your file via FTP, which is a time-consuming process.
Step 2: Get a Telnet/SSH client. I personally use PuTTY, a free telnet/SSH client.
Step 3: Login to your account. Open PuTTY (or your favorite SSH/Telnet client). Under Host Name, enter your domain name or IP address. Under Protocol, it is highly recommended that you select SSH instead of Telnet. Click the Open button at the bottom of the window to connect to your server.
You will be asked to enter your account's username and password. If your login is successful, you will be taken to the prompt, which is typically represented by a dollar sign ($)
Step 4: Backup your database. Enter the following commands:
mysqldump --opt -Q -u USERNAME -pPASSWORD DATABASENAME > BACKUPNAME.sql
Replace USERNAME with the username of your database, replace PASSWORD with the password of your database, replace DATABASENAME with the name of your database, and replace BACKUPNAME with the desired filename of your backup.
When completed, you will be taken back to the prompt. Verify that the BACKUPNAME.sql is in the path you specified. You can compress this file by following similar commands at the next step.
Step 5: Backup your web files.
Go to the directory that you want to backup.
To view the contents of a directoty, enter the following commands:
ls
To change directories, just enter the following:
cd DIRECTORYNAME
Replace DIRECTORYNAME with the desired directory name, For example:
cd public_html
And finally, to compress/archive all the files and subdirectories in that directory, enter the following commands:
tar -cvzf FILENAME.tar.gz *
Replace FILENAME with the desired filename of your backup. Verify that the backup was successfully created. You can do an ls, or view your directory using your FTP client.
Step 5: Download the backup files. Use your favorite download manager. I personally use ReGet and GetRight.
Pretty nifty, huh? Hope this helps.
Trackback(0)

|