Actions

Difference between revisions of "Backup Basics for a Joomla! Web Site"

From Joomla! Documentation

Line 1: Line 1:
Always keep a recent backup of your site. Backups are very useful for many reasons in addition to the accidents that cause data lost.    Joomla sites can be compromised by malicious attackers.  Joomla is designed for a team of editors and any one of them can make an error to harm the site.    There are many reasons website administrators need to revert the site back to a previous working state.
+
Always keep a recent backup of your site. Backups are very useful for many reasons in addition to the accidents that cause data loss.    Joomla sites can be compromised by malicious attackers.  Joomla is designed for a team of editors and any one of them can make an error to harm the site.    There are many reasons website administrators need to revert the site back to a previous working state.
  
It helps to practice both backup and restore.  Nobody should wait for an emergency to test their skills and tools for dealing with an emergency.  Very often people create a backup of something that is empty or corrupted, and discover that none of their critical data was really backed up in the first place.  Nobody likes a ship that sinks with empty lifeboats, and it's also wise to practice getting people out of the lifeboats and into a new working system. Backup and restore also help web managers create a staging website where new risky changes can be practiced without risking the production website.      Staging sites can be on a local machine acting as a test server, or any other folder or web hosting account supporting the SQL and PHP versions used by the site you've backed up.
+
It helps to practice both backup and restore.  Nobody should wait for an emergency to test their skills and tools for dealing with an emergency.  Very often people create a backup of something that is empty or corrupted, and discover that none of their critical data was really backed up in the first place.  Nobody likes a ship that sinks with empty lifeboats, and it's also wise to practice getting people out of the lifeboats and into a new working system. Backup and restore also help web managers create a staging website where new changes can be practiced without risking the production website.      Staging sites can be on a local machine acting as a test server, or any other folder or web hosting account supporting the SQL and PHP versions used by the site you've backed up.
  
 
There are two parts to a complete back up of your Joomla site.  
 
There are two parts to a complete back up of your Joomla site.  
Line 9: Line 9:
 
== Database ==
 
== Database ==
  
One of the first steps to backup your Joomla site is to close the site to public for a few seconds or minutes, backup the files, and then re-open the site.  The steps from phpmyadmin.net omit this much needed operation.  Go to the backend of your Joomla control panel, under global configuration, under the site tab, set "site offline" = yes.  This will then change the look of your configuration.php file in the root of your Joomla website.     
+
One of the first steps to backup your Joomla site is to close the site to public, backup the files, and then re-open the site.  The steps from phpmyadmin.net omit this much needed operation.  Go to the backend of your Joomla control panel, under global configuration, under the site tab, set "site offline" = yes.  This will then change the look of your configuration.php file in the root of your Joomla website.    An administrator will need to use your hosting control panel to view that file or use FTP to download and view the file.  Inside configuraiton.ph you can find the name of your database that will need backing up.  Look for the line with code resembling "var $db = 'x1234';"  Where x1234 is the name of your database. 
  
 +
Using the logon information for your server or hosting company open the PhpMyAdmin tool. Open the database and look for the table named "users" and then click the icon to "view" the data in that table.  You should see the names of staff who have accounts on your Joomla site.  This view provides you the confidence that you are about to backup the correct database.  Click the export tab, then go.  Your browser will download your database into an SQL file.  Find where you browser put that file, then move the file to a much more secure drive or location. 
  
Most managers of a Joomla website also have access to their SQL data using the GUI interface called PhpMyAdmin.  The link below shows the basic steps to backup a database using PhpMyAdmin (common on most web hosts): http://www.phpmyadmin.net/documentation/#faq6_4
+
Most managers of a Joomla website have access to their SQL data using the GUI interface called PhpMyAdmin.  The link below shows the basic steps to backup a database using PhpMyAdmin (common on most web hosts): http://www.phpmyadmin.net/documentation/#faq6_4
 
+
  
 
   
 
   
Alternatively, there are several backup extensions for Joomla 1.5 you could look into, [http://extensions.joomla.org/extensions/access-a-security/site-security/backup/1606 Akeeba Backup (formerly JoomlaPack)] for a full backup of your site or SQL Dumper that can be used for both creating and restoring Joomla databases, Although if for some reason Joomla becomes impossible to log into, the backup will need to be restored through PhpMyAdmin or another method. both these extensions and more are available at http://extensions.joomla.org/
+
Alternatively, there are several more automated backup extensions for Joomla 1.5 [http://extensions.joomla.org/extensions/access-a-security/site-security/backup/1606 Akeeba Backup (formerly JoomlaPack)] for a full backup of your site or SQL Dumper that can be used for both creating and restoring Joomla databases, Although if for some reason Joomla becomes impossible to log into, the backup will need to be restored through PhpMyAdmin or another method. both these extensions and more are available at http://extensions.joomla.org/
 +
 
 +
Server SQL databases can be backed up without PhpMyAdmin and instead using the SQL command line.  If you know how to do that, you're most likely not in need of this documentation. 
  
 
It is recommended to back up the database at least twice per week or even everyday (and more) if you have an active site.
 
It is recommended to back up the database at least twice per week or even everyday (and more) if you have an active site.
Line 22: Line 24:
 
== File System ==
 
== File System ==
  
Besides the DB, you should also back up your site files. The interval for this depends on how often you or your users make changes to the file system. If users can add photos and media or you make changes to the site other than simple text edits, it should be done often. This is best done with an FTP program and is no different than backing up a standard website. Download all the files and folders that exist in the main directory, and save it to a folder on your local computer. Be sure that the file and directory structure remains the same as it is in the live site. You could then burn a CD or save to an external hard drive if you desire.
+
Continue with your site offline, see above.  Your joomla folder and files can be backed up by downloading them with an FTP utility or using the file manager of your webhosting company.  Both of these file options work, neither is better. 
 +
 
 +
FTP tools move thousands of Joomla files and use more time. The FTP process can be slow and interrupted.  Many Joomla sites are hosted by providers like godaddy or hostgator who provide a control panel for taking thousands of files in one folder and then creating a zip file very quickly.  This means your site is offline for a shorter amount of time, and you have only one zip file.  Go to your hosting control panel and look for their file manager icon.  
 +
 
 +
If you use your hosting file manager, practice using that interface to select your server folder and creating a zip file.  Download the zip file locally and then expand it locally to to see what files are inside that zip file. This option also let's you expand the same zip file for restoration to a staging site.
 +
 
 +
Backing up the Joomla files with FTP is no different than backing up a static HTML website. Download all the files and folders that exist in the main Joomla directory.  The downloaded locaiton is a folder on your local computer. Be sure that the file and directory structure remains the same as it is in the live site.   When you restore the files, you will use the FTP utility to upload the files to a new server.
 +
 
 +
When servers are hosted in the same building as the staff, the web administrators should make extra care to not save the database and files in the same building.  Fire, water or other damage often wipes out the live website AND backups.
 +
 
 +
On a regular basis the web administrators should burn both the database and files to CD or save to an external hard drive off site.
  
 
'''TIP.''' If you've never used an FTP client, most hosts provide an FTP capability from within their control panel.
 
'''TIP.''' If you've never used an FTP client, most hosts provide an FTP capability from within their control panel.
  
 
[[Category:Tutorials]][[Category:Security]]
 
[[Category:Tutorials]][[Category:Security]]

Revision as of 17:42, 28 February 2011

Always keep a recent backup of your site. Backups are very useful for many reasons in addition to the accidents that cause data loss. Joomla sites can be compromised by malicious attackers. Joomla is designed for a team of editors and any one of them can make an error to harm the site. There are many reasons website administrators need to revert the site back to a previous working state.

It helps to practice both backup and restore. Nobody should wait for an emergency to test their skills and tools for dealing with an emergency. Very often people create a backup of something that is empty or corrupted, and discover that none of their critical data was really backed up in the first place. Nobody likes a ship that sinks with empty lifeboats, and it's also wise to practice getting people out of the lifeboats and into a new working system. Backup and restore also help web managers create a staging website where new changes can be practiced without risking the production website. Staging sites can be on a local machine acting as a test server, or any other folder or web hosting account supporting the SQL and PHP versions used by the site you've backed up.

There are two parts to a complete back up of your Joomla site. a) The database informormation, most often found in mysql b) The files and folders on your website, most often

Database

One of the first steps to backup your Joomla site is to close the site to public, backup the files, and then re-open the site. The steps from phpmyadmin.net omit this much needed operation. Go to the backend of your Joomla control panel, under global configuration, under the site tab, set "site offline" = yes. This will then change the look of your configuration.php file in the root of your Joomla website. An administrator will need to use your hosting control panel to view that file or use FTP to download and view the file. Inside configuraiton.ph you can find the name of your database that will need backing up. Look for the line with code resembling "var $db = 'x1234';" Where x1234 is the name of your database.

Using the logon information for your server or hosting company open the PhpMyAdmin tool. Open the database and look for the table named "users" and then click the icon to "view" the data in that table. You should see the names of staff who have accounts on your Joomla site. This view provides you the confidence that you are about to backup the correct database. Click the export tab, then go. Your browser will download your database into an SQL file. Find where you browser put that file, then move the file to a much more secure drive or location.

Most managers of a Joomla website have access to their SQL data using the GUI interface called PhpMyAdmin. The link below shows the basic steps to backup a database using PhpMyAdmin (common on most web hosts): http://www.phpmyadmin.net/documentation/#faq6_4


Alternatively, there are several more automated backup extensions for Joomla 1.5 Akeeba Backup (formerly JoomlaPack) for a full backup of your site or SQL Dumper that can be used for both creating and restoring Joomla databases, Although if for some reason Joomla becomes impossible to log into, the backup will need to be restored through PhpMyAdmin or another method. both these extensions and more are available at http://extensions.joomla.org/

Server SQL databases can be backed up without PhpMyAdmin and instead using the SQL command line. If you know how to do that, you're most likely not in need of this documentation.

It is recommended to back up the database at least twice per week or even everyday (and more) if you have an active site.

File System

Continue with your site offline, see above. Your joomla folder and files can be backed up by downloading them with an FTP utility or using the file manager of your webhosting company. Both of these file options work, neither is better.

FTP tools move thousands of Joomla files and use more time. The FTP process can be slow and interrupted. Many Joomla sites are hosted by providers like godaddy or hostgator who provide a control panel for taking thousands of files in one folder and then creating a zip file very quickly. This means your site is offline for a shorter amount of time, and you have only one zip file. Go to your hosting control panel and look for their file manager icon.

If you use your hosting file manager, practice using that interface to select your server folder and creating a zip file. Download the zip file locally and then expand it locally to to see what files are inside that zip file. This option also let's you expand the same zip file for restoration to a staging site.

Backing up the Joomla files with FTP is no different than backing up a static HTML website. Download all the files and folders that exist in the main Joomla directory. The downloaded locaiton is a folder on your local computer. Be sure that the file and directory structure remains the same as it is in the live site. When you restore the files, you will use the FTP utility to upload the files to a new server.

When servers are hosted in the same building as the staff, the web administrators should make extra care to not save the database and files in the same building. Fire, water or other damage often wipes out the live website AND backups.

On a regular basis the web administrators should burn both the database and files to CD or save to an external hard drive off site.

TIP. If you've never used an FTP client, most hosts provide an FTP capability from within their control panel.