Backing up and restoring JIRA

For any applications running in a production environment, it is critical that their data is backed up regularly, so that they can be restored in case of a disaster.

The first thing you will need is to have a disaster recovery plan in place. This plan should outline the details of the strategy in place to back up JIRA's data and where the backups should be stored, and the recovery process of restoring the data. In context of JIRA, there are typically two items you will need to backup:

  • Database: This is where JIRA stores most of its critical data, such as issues and configuration settings. It is recommended to use the native database backup tools available for your database (for example, mysqldump for MySQL).
  • JIRA_HOME: This is where JIRA stores other important files, such as attachments and third-party add-ons. Since this is a directory sitting on the filesystem, you will need a native tool to back up the files (for example, Scheduled Tasks in Windows).

JIRA also comes with an XML backup/restore feature, which will back up the data from the database into an XML file. This utility, however, is not designed to be used for large JIRA instances (for example, with 200,000 issues or more). It is important to note that data kept in JIRA_HOME is not backed up.

Tip

You should always use proper backup tools instead of relying on the built-in XML backup system.

Creating an XML backup

JIRA comes with a simple backup utility that lets you backup your data into an XML file, which can be later imported back in to restore JIRA. However, you must keep in mind that you should not rely on this utility as your sole backup strategy, as this option has several limitations:

  • It cannot be used to back up large JIRA installations. JIRA is unable to restore backup files that are 2 GB or greater in size.
  • It does not back up data on the filesystem, such as attachments.

Nonetheless, this can still be very handy when you need a quick way to perform a one-off backup before you make some system-wide changes such as an upgrade, or you need to copy data from one JIRA to another. Perform the following steps to create an XML backup:

  1. Browse to the JIRA administration console.
  2. Click on Backup System under Import & Export.
  3. Specify the name of your exported XML file. The created backup file will always be a ZIP file.
  4. Click on the Backup button:
    Creating an XML backup

Depending upon the size of your JIRA, the backup process will take some time to complete. Once the backup process completes, JIRA will display the confirmation page with the full path to the exported XML file. If your JIRA has too much data, the backup will fail with an error. If this occurs, you will have to back up your data using your database backup tools.

Restoring from an XML backup

Once you have generated an XML backup, you can use that to restore your JIRA by importing it back in. Please note that when you perform a restore, the existing data will be completely wiped, including your JIRA license information, which will also be restored from the XML backup:

  1. Browse to the JIRA administration console.
  2. Click on Restore System under Import & Export.
  3. Specify the XML backup file to restore from. Note that JIRA will look for the file inside the JIRA_HOME/import directory.
  4. Optionally, supply a new JIRA license. You will need to do this if you want to override the license information from the backup file.
  5. Click on the Restore button to start the restore process:
    Restoring from an XML backup

Since attachments are not a part of the XML backup, the restore process will not restore the attachments, however, if you are restoring a backup from the same instance, attachments will be automatically located. While JIRA is in the process of restoring from a backup, users will not be able to access JIRA.

You can only restore an export from the same or an older version of JIRA. For example, you cannot restore an export from JIRA 5.2 into JIRA 5.1.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset