This article also suits webmasters looking for:
backup files on shared hosting, manual backup on shared hosting, file compression not working in cPanel, file compression taking too long in file manager
Situation: I recently ran into a situation where one of my client wanted to sell his wallpaper website and the collection of files was huge. I am talking hundreds of gigabytes here. I was not able to create an automatic backup using any of the available backup plugins as the script was giving a timeout error. I tried compressing the folder using cpanel’s file manager so that I could download it but it took forever and zip file never got created. Now I could have started the download via ftp but it would have taken about 1000% of regular download time to finish downloading (ftp download of multiple files is slower than downloading them in a chunk because the protocol requires the transfer’s success to be acknowledged each time).
Solution: With backup plugins not working and FTP not a fancy solution, I was left with the only option of using SSH to compress the folder and then download it. This method requires you to have ssh access so make sure you have it before we begin. You can initiate a live chat session with your hosting support, start a ticket or simply give them a call.
1. Open an SSH client & connect to your server
Login to your server using your SSH details provided by your hosting company. In most cases it is:
ssh -p 2222 firstname.lastname@example.org ## 2222 is the port used on hostgator. Default SSH port is 22. It might vary for security reasons. ## cnapelusername - the username you use to login ## 126.96.36.199 - The IP Address of your server that can be found in the left sidebar when you log into cpanel
2. Change your path to the directory where you would like to create backup
On Hostgator, you log into the directory containing public_html (something like
/home3/cpanelusername) folder by default. You can see your current directory by typing in the command
pwd. Change the directory to the one where our folder that needs backing up is by typing in the following command:
Note: if you wish to backup entire public_html directory, there is no need to change directory.
If you can’t remember the name of directory you wanted to backup (don’t worry happens to me all the time), type in the following command:
3. Zip the folder you wish to backup
Now that we are in the correct directory, let’s get on with the magic:
zip -r sitebackup.zip websitetobebackedup.com/
The zipping will take a while so you might want to grab a cup of coffee or do some exercise 🙂 Download the zipped file by pointing to this file in a browser or your download manager like:
http://xxx.xxx.xx.xxx/sitebackup.zip (replace xxx bit with your server’s ip address)
You can backup and hence download the database for this website using the phpmyAdmin tool in your cPanel.
This finishes our manual site backup. If you have any questions, feel free to ask them in the comments section below.
Latest posts by Vikas Thakur (see all)
- Best desktop tools for bloggers - May 2, 2014
- How to take the backup of a huge website on hostgator or any other shared hosting - April 18, 2014
- 5 Alternatives to Stock Photos - April 8, 2014