How to create automatic backups in Jira Cloud
Share on socials
How to create automatic backups in Jira Cloud
Jarin McClinton
23 October 2024
7 min read
Jarin McClinton
23 October 2024
7 min read
Many of our customers come to us with the desire or requirement to be able to back up their Jira cloud data automatically. However, Atlassian currently does not officially offer data rollback upon customer request. Therefore, it is crucial to create a site backup regularly. For example, the backup will help you if data on a site is lost due to the user's work. In this article, we will describe how to achieve this functionality using RestAPI and scripts. We will first look at automation for Jira and then introduce Powershell, Python, or Linux scripts that make this possible. We will also include some valuable add-ons if you want a ready-made solution from Atlassian's Marketplace.
Jira Cloud backup limitations
Currently, Jira Cloud does not offer scheduled backups or download features. A backup can only be created every 48 hours, but that doesn't mean it can't be done. Quick disclaimer: this solution will be relevant as long as the long-running CLOUD-6498 ticket is unresolved.
Here are our solutions for automatic data storage in Jira Cloud:
- Solution 1: How to use automation for a Backup
- Solution 2: Run a script on Windows server or Linux client
- Solution 3: Atlassian Add-ons
Solution 1: How to use automation for backup
With the help of automation in Jira Cloud, it’s possible to trigger the creation of a backup automatically. This ensures that your data is not lost and is always available. The only thing that cannot be automated is downloading the data.
Step-by-step run-through
- You will first need an administrator account and the corresponding login data.
- You will need to use Base64 coding to create your access token. You can access Base64 here.
- First, you need to access the account's API token from this page.
- Then, create a token and save it.
- Launch the encoder and insert the credentials as follows: "{your email}:{your token}"
- Close and save it: you’ll need it later!
- Then, you need to set up an automation to schedule a backup.
- Go to your automation page and create an automation.
- Add 'Scheduled Trigger' and define an extended cron expression. For example, you can use 0 0 9 ? * 1.4. This would create backups on Monday and Thursday at 9am. Remember that you can only get backups every 48 hours.
- Now you need to add the action "Send web request".
- In this web request, define the details as follows and change "yoursitename" and "yourtoken".
- After that, you can run the rule manually and check the results.
✅ Advantages
- You have the option to automatically create backups every three to four days to ensure that you can download the latest backup when needed.
❌ Disadvantages
- You will always only have the last backup.
- You have to download the backup manually.
- The backup is only available for 14 days on Jira and seven days on Confluence.
Solution 2: Run a script on Windows server or Linux client
In this solution, we will provide you with scripts that you can run on your own client. The step-by-step instructions are for Windows clients only, but the other scripts can also be used for Linux clients. You will need to run these scripts on your own hosted servers. Furthermore, for this solution, you need administrator rights for your instance.
Step-by-step run-through
- First, download the script here and save it as it is.
- You also need to create a token here (do not lose this token).
- Replace the script for your own website:
- In line 2, replace the part with ' ' with the name of your website. For example, if your website is called examplesite.atlassian.net, you only have to write 'example site'.
- Replace line 3 with your email.
- Replace line 4 with the token you got in step 2.
- Replace line 5 with your backup directory. For example, if your directory is "C:\Users\Atlassian Backup Script", you should write "C:\Users\Atlassian Backup Script" to ensure it is created in that directory.
- Lines 6 and 7 are optional. In this case, line 6 should be true to get the attachments as well.
- After that, you need to create a scheduled task in Windows Task Scheduler.
- Create a new task within the actions.
- First, you need to define a trigger. The trigger is the schedule according to which you want to run the script. In this example, we have defined the script to run every Monday and Thursday at 12:50. Remember that again, a backup can only be performed every 48 hours.
- Now you need to specify what you want to do. Go to "Actions" and add a new action.
- You need to define PowerShell, as this is the program that runs the backup.
- In the arguments, you must specify the script address. You can use the browser for this.
- Now, you can create a backup under Windows. For larger instances, the backup may take longer than one hour, so be sure to define the trigger to run longer than an hour.
- You can use this script here to implement this solution as a Python script, or to implement it under Linux using this documentation, to define the Cron-Job.
✅ Benefits
- You have your own server to run a job and directly download the backup file.
- You can use this on Linux, Windows, or Python scripts.
❌ Disadvantages
- The endpoints used in these scripts may change over time, as they do not originate from Atlassian. Double-check the script provided in step 1.
- Your server/host must have a connection to Atlassian listed here.
Solution 3: Atlassian add-ons
Sometimes things have to happen quickly, and you need a simple, out-of-the-box solution. There are several solutions for this in the Atlassian marketplace:
- These apps use their own infrastructure to create daily backups, automate data recovery for Jira Cloud— just be sure that they meet the security and compliance requirements of your organisation:
- Here you can access further alternatives from the Atlassian Marketplace.
✅ Advantages
- You can create daily backups as the apps use their own infrastructure to run backups through API calls.
- Some applications, such as Rewind, also provide audit and monitoring logs.
❌ Disadvantages
- For these solutions, you need a subscription.
- These solutions may also introduce usage-based/size-based costs.
- Third-party apps may have different data hosting and processing locations to Atlassian, so be sure to check your security and compliance requirements.
Conclusion
Even though Atlassian does not (yet) offer automatic storage of your Jira cloud data, there are numerous ways to do it yourself and ensure the backup of your data. Whichever method you choose—automation, scripts, or third-party apps—we'll be happy to help you implement it, and support you with any problems that may arise.
Contact us if you have any questions or suggestions.
Further subject-relevant resources
- Comparison: Data Center vs Cloud
- Bitbucket: Automatic Cloud Backup-Scripts
- Atlassian Community: Backup and Restore group
- Jira Software Support: Automated Backups for Jira Cloud
- Cloud Support: Jira Cloud Automation
- Atlassian Community: Automate online site-backups for Jira and Confluence without programming
Written by
Jarin McClinton
Global Head of Professional Services
With over 10 year's experience as a scrum master, solutions architect, and technical consultant, Jarin has intimate knowledge of how to solve complex business problems with technology. He oversees our global consultancy, delivering strategies that enhance customer satisfaction and drive growth.
Atlassian
Work management