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

From Joomla! Documentation

(Marked this version for translation)
 
(46 intermediate revisions by 13 users not shown)
Line 1: Line 1:
Backing up data is vital for businesses; lost information can cause a major crisis or worse, lead to business failure. Individuals who don't backup computer data run the same risk. While this may not cause financial ruin, it can certainly be frustrating and even heartbreaking. Computers aren't perfect. Servers malfunction or are open to vulnerabilities, files become corrupt due to script kiddies or malware bots, motherboards malfunction, CPUs call it quits taking our precious data with them. Data backup can mean the difference between a slight computer setback and living through your own electronic apocalypse.
+
<noinclude><languages /></noinclude>
 +
<translate><!--T:1-->
 +
Always keep a recent backup of your site. Accidents happen, but there are many other reasons to have your backup files handy before the need arises. '''N.B. backups should not be used to restore a hacked site because the hack  could have been on the site for some time could have been backed up with the site.'''</translate>
  
Backing up data is vital for businesses; lost information can cause a major crisis or worse, lead to business failure. Individuals who don't backup their Joomla site run the same risk. While this may not cause financial ruin, it can certainly be frustrating and even heartbreaking.  
+
<translate><!--T:2-->
 +
The causes of data loss are many. Joomla sites can be compromised by malicious attackers if the site administrator has not paid attention to security or in cases when hackers bypass the best security. Joomla! is designed for teamwork, and even good editors can make an error that harms the site.</translate>
 +
 
 +
<translate><!--T:3-->
 +
There are many reasons website administrators need to revert the site to a previous working state.</translate>
 +
 
 +
<translate><!--T:4-->
 +
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 backed up. Nobody likes a ship that sinks with empty lifeboats. It's also wise to practice getting people out of the lifeboats and into a new working system.</translate>
 +
 
 +
<translate><!--T:5-->
 +
Having a backup is not just about accidents; a person well versed in backup can help with safe development of new features. Backup and restore help web managers create a staging website where new changes can be practiced without risking the production website. The clone can be created 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.</translate>
 +
 
 +
<translate><!--T:6-->
 +
It's easy for anyone to mix up their live site and staging site, so change the color of your staging site template to remind developers that the staging site is not live to the public.</translate>   
 +
 
 +
<translate>
 +
== Back Up a Joomla Website Using Akeeba  (Common method) == <!--T:74-->
 +
</translate>
 +
 
 +
<translate>
 +
<!--T:75-->
 +
This is the preferred method using the Akeeba Backup Extension.</translate>
 +
<translate><!--T:67-->
 +
* Akeeba Backup produces a ''.jpa'' file.</translate>
 +
<translate><!--T:68-->
 +
* The compressed ''.jpa'' file contains all the Website's files and the content of the database.</translate>
 +
<translate><!--T:69-->
 +
* The ''.jpa'' file also includes an installer.</translate>
 +
<translate><!--T:70-->
 +
* Akeeba's ''kickstart.php'' unpacks the ''.jpa'' file.</translate>
 +
<translate><!--T:71-->
 +
* You then run the installer and install your site like a Joomla install.</translate>
 +
<translate><!--T:72-->
 +
* The installer changes the configuration for restoring to a different location and prompts for the new database details.</translate>
 +
 
 +
<translate><!--T:73-->
 +
You can download the Akeeba Backup extension from the [https://extensions.joomla.org/extensions/extension/access-a-security/site-security/akeeba-backup/ Joomla extension directory]. There is a link to full instructions there as well.</translate>
 +
 
 +
<translate>
 +
 
 +
== Backup Two-Part Method == <!--T:7-->
 +
</translate>
 +
 
 +
<translate><!--T:8-->
 +
There are two parts to a complete back up of your Joomla site. They are:</translate>
 
   
 
   
Backing up your site involves the storing of files/folders and database information from your server in another location. In this way, if there is ever any loss of data on your server, you still have your data in backup in order to restore those files. In the world of computers, loss of data can be devastating, and while there are possibilities for recovery of data after a disaster it is far easier to restore your files/db from backup than having to restore manually your entire Joomla website. So make regular backups and store them on different media i.e. a flash disk (or 2 to make sure you still have one if your flash disk gives up on you!) or a commercial Cloud storage provider such as [http://aws.amazon.com/s3/ Amazon S3]
+
<translate><!--T:9-->
 +
# The database information, most often found in your MySQL database.</translate>
 +
<translate><!--T:10-->
 +
# The files and folders on your website, as hosted on most static HTML websites.</translate>
  
Check always that the backup you make is not corrupt and contains the actual data! You can create a copy of your site on a local installed server to test the backup and/or practice restoring your site.(see link below " Copying a Joomla website "
+
<translate><!--T:11-->
 +
If you do not backup your files and database, your backup is incomplete.</translate>
  
== Summary ==
+
<translate>
 +
=== Database Backup === <!--T:12-->
 +
</translate>
  
To backup your webesite you will need to backup:
+
<translate><!--T:13-->
+
One of the first steps to backup your Joomla site is to close the site to the public, backup the files and then re-open the site. The steps from [https://docs.phpmyadmin.net/en/latest/index.html the phpMyAdmin documentation] omit this much needed operation. Go to {{rarr|Joomla Administrator,Global Configuration,Site}} tab, set ''Site Offline'' = 'Yes''.</translate>
a) Your Joomla database [and]
+
 
 +
<translate><!--T:14-->
 +
This will then change the ''configuration.php'' file in the root of your Joomla website.</translate>
 +
 
 +
<translate><!--T:15-->
 +
An administrator will need to use your hosting control panel to view that file or use FTP to download and view the file. Inside the ''configuration.php'' file you can find the name of your database that will need backing up.</translate>
 +
 
 +
<translate><!--T:16-->
 +
Look for the line with code resembling <code>var $db = 'x1234';</code> or <code>public $db = 'x1234';</code>  Where ''x1234'' is the name of your database.</translate> 
 +
 
 +
<translate><!--T:17-->
 +
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.</translate>
 +
 
 +
<translate><!--T:18-->
 +
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.</translate>
 +
 
 +
<translate><!--T:19-->
 +
Click the ''export'' tab, then ''Go''.</translate>
 +
 
 +
<translate><!--T:20-->
 +
Your browser will download your database into an SQL file.</translate>
 +
 
 +
<translate><!--T:21-->
 +
Find where you browser put that file, then move the file to a much more secure drive or location.</translate> 
 +
 
 +
<translate><!--T:22-->
 +
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.</translate> 
  
b) The files and folders of your website
+
<translate><!--T:23-->
 +
It is recommended that you back up the database at least twice per week or even everyday (and more) if you have an active site.</translate>
  
== Manual System Backup ==
+
<translate>=== File System Backup === <!--T:24--></translate>
  
How to backup the database and site is well documented in [http://docs.joomla.org/Copying_a_Joomla_website[Copying a Joomla website]
+
<translate><!--T:25-->
 +
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 web hosting company. Both of these file options work, neither is better.</translate> 
  
For the database back-up we use phpMyadmin and a good tutorial can be found at [http://joomlatutorials.com/joomla-tutorials/joomla-15x/joomla-15x-administration/backup-database.html Joomlatutorials]
+
<translate><!--T:26-->
 +
FTP tools move thousands of Joomla files and use more time. The FTP process can be slow and interrupted. Most hosting companies provide a control panel for taking thousands of files in one folder and then creating a zip file very quickly.</translate>
  
For backing up your files and folders you need to use an FTP-client such as the very popular [http://filezilla-project.org/ Filezilla] or any of the dozens described in this [http://en.wikipedia.org/wiki/Comparison_of_FTP_client_software wiki-entry] but check the [http://forum.joomla.org/index.php Joomla forum] what is widely used if your are not sure what ftp-client is suitable for you!
+
<translate><!--T:27-->
 +
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.</translate> 
  
== Automated system backup ==
+
<translate><!--T:28-->
 +
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.</translate>
  
Several automated [http://extensions.joomla.org/extensions/access-a-security/backend-a-full-access-control backup extensions] for Joomla 1.5 are available and highly sophisticated is the free backup and restore extension [http://extensions.joomla.org/extensions/access-a-security/site-security/backup/1606 Akeebabackup] which offers in its commercial version several interesting and helpful features as fully automated backups via cronjobs.
+
<translate><!--T:29-->
 +
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 location 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.</translate>
  
== More Backup and Restore Documentation ==
+
<translate><!--T:30-->
 +
'''As soon as you've downloaded your files, via zip or FTP, change your site to be online.'''</translate>
  
Frequent backups are the best way to make sure you can recover if your site has a problem. This video entitled [http://video.google.com/videoplay?docid=2742157386318372444 How to backup and restore a Joomla! database using phpMyAdmin] by kristofdb explains also the steps.  
+
<translate>
 +
== More Backup Documentation == <!--T:31-->
 +
</translate>  
  
More info on phpMyAdmin can be found at the homepage of [http://www.phpmyadmin.net/home_page/index.php PhpMyAdmin]  
+
<translate><!--T:32-->
 +
Most administrators of a Joomla website have access to their MySQL data using the GUI interface called phpMyAdmin, see [https://docs.phpmyadmin.net/en/latest/faq.html#how-can-i-backup-my-database-or-table How can I backup my database or table?] for more information.</translate>
 
   
 
   
Never store the backup on your own server (!) Also do not backup your site(s) on a mirror disk (VPS/Dedi server) on the same server ''only'' since the entire server or datacentre might burn out!
+
<translate><!--T:33-->
 +
There are several automated backup extensions for Joomla! located in the [https://extensions.joomla.org/ Joomla! Extensions Directory]. Here is a link for [https://extensions.joomla.org/extension/?searchall=backup&controller=filter Joomla! Backup Extensions].</translate>
 +
 
 +
<translate><!--T:34-->
 +
When servers are hosted in the same building as the staff, the web administrators should make extra care to store the backup copies of the database and files in a different building. Fire, theft, 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 a CD or save to an external hard drive off site.</translate>
 +
 
 +
<translate>
 +
== Special Notes == <!--T:35-->
 +
</translate>
 +
 
 +
<translate>
 +
=== Two Factor Authentication (2FA) === <!--T:36-->
 +
</translate>
  
 +
<translate><!--T:37-->
 +
If you use two factor authentication (available since Aug 2014) and you are locked out of your site, you can rename the folder ''plugins/twofactorauth'' to ''twofactorauth.BAK'' and log in to your site's back-end. Then disable all plugins under the ''twofactorauth'' group. Finally, rename the ''plugins/twofactorauth.BAK'' folder of your site to ''twofactorauth''.</translate>
 +
<translate><!--T:38-->
 +
*See also the [[S:MyLanguage/J3.x:Two_Factor_Authentication|Two Factor Authentication]] tutorial.</translate>
  
[[Category:Tutorials]][[Category:Security]]
+
<noinclude>
 +
<translate>
 +
<!--T:50-->
 +
[[Category:Tutorials]]
 +
[[Category:Security]]
 +
[[Category:Incoming External Link]]
 +
</translate>
 +
</noinclude>

Latest revision as of 17:03, 24 August 2020

Other languages:
Bahasa Indonesia • ‎Deutsch • ‎English • ‎Nederlands • ‎eesti • ‎español • ‎français • ‎português • ‎português do Brasil • ‎русский • ‎हिन्दी • ‎বাংলা • ‎中文(台灣)‎

Always keep a recent backup of your site. Accidents happen, but there are many other reasons to have your backup files handy before the need arises. N.B. backups should not be used to restore a hacked site because the hack could have been on the site for some time could have been backed up with the site.

The causes of data loss are many. Joomla sites can be compromised by malicious attackers if the site administrator has not paid attention to security or in cases when hackers bypass the best security. Joomla! is designed for teamwork, and even good editors can make an error that harms the site.

There are many reasons website administrators need to revert the site to a previous working state.

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 backed up. Nobody likes a ship that sinks with empty lifeboats. It's also wise to practice getting people out of the lifeboats and into a new working system.

Having a backup is not just about accidents; a person well versed in backup can help with safe development of new features. Backup and restore help web managers create a staging website where new changes can be practiced without risking the production website. The clone can be created 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's easy for anyone to mix up their live site and staging site, so change the color of your staging site template to remind developers that the staging site is not live to the public.

Back Up a Joomla Website Using Akeeba (Common method)[edit]

This is the preferred method using the Akeeba Backup Extension.

  • Akeeba Backup produces a .jpa file.
  • The compressed .jpa file contains all the Website's files and the content of the database.
  • The .jpa file also includes an installer.
  • Akeeba's kickstart.php unpacks the .jpa file.
  • You then run the installer and install your site like a Joomla install.
  • The installer changes the configuration for restoring to a different location and prompts for the new database details.

You can download the Akeeba Backup extension from the Joomla extension directory. There is a link to full instructions there as well.


Backup Two-Part Method[edit]

There are two parts to a complete back up of your Joomla site. They are:

  1. The database information, most often found in your MySQL database.
  2. The files and folders on your website, as hosted on most static HTML websites.

If you do not backup your files and database, your backup is incomplete.

Database Backup[edit]

One of the first steps to backup your Joomla site is to close the site to the public, backup the files and then re-open the site. The steps from the phpMyAdmin documentation omit this much needed operation. Go to Joomla Administrator  Global Configuration  Site tab, set Site Offline = 'Yes.

This will then change the 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 the configuration.php file you can find the name of your database that will need backing up.

Look for the line with code resembling var $db = 'x1234'; or public $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.

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 that you back up the database at least twice per week or even everyday (and more) if you have an active site.

File System Backup[edit]

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 web hosting 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. Most hosting companies 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 location 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.

As soon as you've downloaded your files, via zip or FTP, change your site to be online.

More Backup Documentation[edit]

Most administrators of a Joomla website have access to their MySQL data using the GUI interface called phpMyAdmin, see How can I backup my database or table? for more information.

There are several automated backup extensions for Joomla! located in the Joomla! Extensions Directory. Here is a link for Joomla! Backup Extensions.

When servers are hosted in the same building as the staff, the web administrators should make extra care to store the backup copies of the database and files in a different building. Fire, theft, 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 a CD or save to an external hard drive off site.

Special Notes[edit]

Two Factor Authentication (2FA)[edit]

If you use two factor authentication (available since Aug 2014) and you are locked out of your site, you can rename the folder plugins/twofactorauth to twofactorauth.BAK and log in to your site's back-end. Then disable all plugins under the twofactorauth group. Finally, rename the plugins/twofactorauth.BAK folder of your site to twofactorauth.