Automating JIRA backups
| 
PDF |
JIRA can be configured to automatically create an XML backup of JIRA data on a routine basis. This backup
includes all data in the database, but not attachments, which are on the filesystem.
Note
For production use, it is
strongly recommended to use
native
database-specific tools instead of the XML backup service. The XML backup is not guaranteed to be
consistent, as the database is not locked during the backup process.
When JIRA is installed, the first step in the Setup Wizard prompts you for a backup path,
and if entered, JIRA will automatically generate XML backups (as ZIP files) every 12 hours. If you did not specify this
path, follow the steps below to enable automated backups. (Note that you can also perform XML backups manually —
see Backing up data.)
- Log in as a user with the 'JIRA System Administrators' global permission.
-
Bring up the administration page by clicking either the 'Administration' link on the top bar or the title of the
Administration box on the dashboard:


-
Under the 'System' sub-menu in the left-hand navigation column, click the
'Services' link.
- This will display the 'Services' page. It lists the current
services running on this system. By default there should be
one service running: 'Mail Queue Service'. You cannot delete this
service.
-
Fill in the 'Add Service' form as follows:
- For 'Name', enter a descriptive name, e.g. Backup Service
- For Class, enter
com.atlassian.jira.service.services.export.ExportService
- For 'Delay', enter the number of minutes between backups. A good default for this
would be 720 minutes (12 hours).
Click the 'Add Service' buttont.
-
This will display the 'Edit Service' screen. Fill in the following fields:
- For 'Directory Name', type the full path of the directory to which JIRA will write
backup files. Note: Ensure that JIRA has rights to write to this location.
-
For 'Date format', specify the format which JIRA will use to name the individual backup files.
This format can be anything that SimpleDateFormat can
parse. A good default is 'yyyy-MMM-dd-HHmm', which would generate files named like this: '2007-Mar-05-1322'.
-
For 'Backup as:', either:
- Select 'XML' to have JIRA store your data as an XML file; or
- Select Zip' to have JIRA to compress your backup and store it as a ZIP file.
- Your backup service is now configured. XML backups will be performed according to the schedule you specified in the Delay field
(above).
-
For every successful backup, an XML (or ZIP) file will be saved in the backup directory that you specified in the Directory Name
field (above).
-
If a scheduled backup fails for any reason, the XML (or ZIP) file will be saved into the 'corrupted' directory, which is directly under your nominated
backup directory. (NB. JIRA will created the 'corrupted' directory if required — you don't need to create it.) Additionally, a file
explaining the reason for the failure will be written to the 'corrupted' directory. This file will have the same name as the backup file, but
with the extension '.failure.txt'.