Backing up Atlassian OnDemand

Reason

When somebody wants to backup either the JIRA or Confluence onDemand databases.

Context

Atlassian onDemand does not currently have any features for automating a backup of either JIRA or Confluence.  To get around this we can trigger a backup from Atlassian and then automatically download the resulting file to a location of our choosing.  We can take this a step further by automating this processes with a cron job on Mac or Unix, or by using Windows Task Scheduler.

Disclaimer

These scripts were based on one given for Jira by Marlon Aguiar of Atlassian, the original can be found here.  Some minor modifications were made and a separate script for Confluence was created from the resulting code.


Guide

Jira

  • Create a bash script with the following code, filling in your Atlassian username and password.  Save it as “JiraBackup.sh”.
  • Make the script executable with
chmod +x JiraBackup.sh
  • Execute the script with
./JiraBackup.sh

Confluence

  • Create a bash script with the following code, filling in your Atlassian username and password.  Save it as “ConfluenceBackup.sh”.
  • Make the script executable with
chmod +x ConfluenceBackup.sh
  • Execute the script with
./ConfluenceBackup.sh

The scripts will trigger a backup and automatically download the resulting file to a specially created Backups folder located in the same directory where the script is.

Automating

Windows

Windows users are able to automatically trigger the script by using Windows Task Scheduler.  It is very easy to set up and more information can be found here http://technet.microsoft.com/en-us/library/bb726974.aspx

Mac/Unix

The easiest way to automatically trigger this at regular intervals is to set up a cron job.

  1. In the terminal, open your crontab
    crontab -e
  2. Press i to enter vim’s insert mode
  3. Enter your jobs.  The following example will trigger the jobs every 3 days
    00 00 3 * * <PATH TO SCRIPTS>/BackupJira.sh
     00 00 3 * *<PATH TO SCRIPTS>/ConfluenceBackup.sh
  4. Press [ESC] to exit insert mode
  5. Type ZZ (Must be capitals)
  1. You can verify the new entries with
    crontab -l

 


 

 

Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *