Backing Up Your Site With the JoomlaPack Extension Part 1
February 25th, 2009 by 4SightDSPart I - Installation

Introduction
After looking at several of the available backup extensions for Joomla we have decided to run with JoomlaPack as the backup solution for all our website projects. The reason for this is that not only does JoomlaPack back up the a sites entire database but it also has the ability to backup all of the websites files into a zip file that can be used to restore the whole site to either its original location, a new location on the same server or even a whole different server! JoomlaPack can also be scheduled to run in the cron so that the backup process can be automated.
JoomlaPack is delivered as a Joomla Component and is available in both 1.0 Native as well as 1.5 Native versions.
Installation
Installation is straight forward. All you have to do is to grab a copy from the JoomlaPack website which you can do here: http://www.joomlapack.net/download/JoomlaPack-Components-download.html, save it somewhere to your local computer and then install it from the Extensions|Install|Uninstall menu in the Joomla Administrators back end control panel.
Once the extension has been installed it will let you know on the front page of its control panel (found under the Components menu in the Joomla Administrators back end) whether or not there were any issues with its installation that you need to attend to.
Backup Folder Permissions
On some systems we have found that the default folder permissions set on the backup folder (the folder your backups are stored in when they are created) are not sufficient to allow the system to actually create the backup file. In such a case you will be alerted that there is a problem via a message on the JoomlaPack control panel as seen below.

At a minimum the backup directory folder permissions should be set to:
- User: Read/Write/Execute
- Group: Read/Write
- Other: None
In Linux terms this means that you need to set the file permissions to 760.
(If you don’t have a good understanding of *nix file permissions a good article on them can be found in the “How Linux File Permissions Work” article on nixCraft.)
If you use a hosting service for your website this can be accomplished either via whatever control panel they provides for you (such as Plesk or CPanel) or, if you have an account that is Secure Shell (SSH) enabled you can ssh into your server, log in as root, and change the folders permissions by changing directories to the /joomla15/administrator/components/com_joomlapack directory under your websites root install folder and issuing the command “chmod 760 backup” . If your system does not allow you to ssh in as root then, if sudo is configured correctly you should be able to accomplish the same task by issuing the command “sudo chmod 760 backup”. In either case this gives the folders user full control, group read and write permissions only and no permission to other (everyone else).
Changing the Backup Folder Permissions in Plesk
To make the permission change using the Plesk control panel first log into Plesk and then click on the “Domains” link in the upper left corner of the control panel:

Next select the domain your web site is on by clicking on the domain name at the bottom of the page.

Then click on the file manager in the bottom right of the control panel:

Then select the root folder your web site resides under:

Now browse to the administrator/components/com_joomlapack directory. If your site is a sub domain and is not in the root of your web server then you will have to select the sub-folder from which it runs otherwise start with the administrator directory:

Then the components directory:

And then click on the com_joomlapack folder:

Once you’ve clicked on the JoomlaPack directory you will see the backup folder. Set the backup folders rights by clicking on the link for its permissions to open the permission dialog box:

Permissions at a minimum should be set as follows:

Changing the Backup Folder Permissions via SSH
First, fire up your favorite SSH client and log into your hosting server. We like to use Putty.

Then change directories to the com_joomlapack directory

Now chmod the folders permissions:

No run the ls -l command to see your changes:

In some cases we have found that the permissions have to be set to 766 and we have see posts from users on other boards that that had to set the permissions to 770 or even 777. Unfortunately permissions are not an exact science because of the multitude of combination’s of layers of software a site may or may not be running (PHP version , web server and web server version, cgi, etc) .
If you would like a more in depth look into how web servers work and how permissions affect Joomla! installations there is a very good discussion of it in the JoomlaPack online documentation which can be found here: http://www.joomlapack.net/help-support-documentation/joomlapack-2x-documentation/pt03.html
Security
You will also, if your site is running under an Apache web server, want to make sure that the installer wrote a .htaccess file into the backup directory. It is supposed to be written there by default but it is always good to double check as, if your site is running under an Apache web server then this file will prevent prying eyes from looking at your backup directory. If your site is not running under an Apache web server then this file will not do anything.
The .htaccess file should have only one line int it: “deny from all”
By placing this file in the backup directory, under an Apache web server, anyone who tries to browse directly to the JoomlaPack backup directory on your web site will be greeted with the familiar Access Denied page like so:

Better Security
Since this is a well known plug-in the default directory for system backups is no big secrete and as such we recommend, as do JoomlaPack themselves, that before you start making backups you move the backup directory to a different location. Preferably this would be somewhere below the root of your web servers root directory (usually the HTTP directory).
This won’t be a problem if you are on a dedicated or even a VPS (virtual private server) but you may not have access below your web servers HTTP directory if you are on a shared hosted server. I do know from experience however that if your site is on a shared hosted server on GoDaddy that if you enable SSH for your site then you will be able to shell in and create a backup directory below the HTTP root of your web server.
To accomplish this through a control panel I’ll give an example in Plesk.
Creating a Backup Directory Below Your Root HTTP Directory Using Plesk
Again, as above, log in to Plesk, select your domain and open the file manager. once the file manager is open you should already be in the directory below your HTTP root folder. On this system the HTTP root folder is called httpdocs.
Click on the Add Directory link.

Enter a name for your backup directory and click the “OK” button

If you don’t have permission to create files and folders in this directory you will see the an error similar to the following:

If you can not create a directory here then your service provider may not allow you to by design. You will have to contact your hosting provider and see what, if anything, can be done.
If you were able to create the directory then change the permissions on it as described above in the section “Changing the Backup Folder Permissions in Plesk” , then go back into your Joomla! Administrator back end control panel and open up the JoomlaPack! control panel from Components menu (Components|JoomlaPack).
Once there click on the Configuration button:

Now edit the default backup directory path to reflect your new backup folder location:

Finally, click the apply button in the top right corner:

Creating a Backup Directory Below Your Root HTTP Directory Using SSH
Again, as described above in the section “Changing the Backup Folder Permissions via SSH”, log into your web server.
By default you should end up logged in to the folder below your web servers HTTP root directory. Run ls-l to see what folders are there. If you see your HTML root directory (here it is just html) the you are in the right place. If you don’t see your HTTP root directory you will have to browse around for it.

Now create a directory for your backups:

Next use chmod to change the permission on the newly created backup directory to 760:

Now all that is left to do is to change the backup location in the JoomlaPack control panel:

And then save your changes by clicking apply in the upper left hand corner:

And Now you are ready to start backing up your Joomla! site with JoomlaPack.
Backups will be covered in a day or so in the next installment of this article.
