Automate backups for Jira and Confluence Cloud
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
Atlassian Cloud products don't automatically back up data. You can back up data (excluding attachments) anytime. Backups with attachments require 48 hours between each backup.
Solution
Automate Cloud backups using Automation
Automation in Jira and Confluence Cloud can help you automate your cloud site backups without requiring custom scripts or programming experience.
This workaround makes use of the Send web request automation action along with an API key generated by a Jira and/or Confluence administrator.
Info 1
This approach is not officially supported and is currently maintained by the community. Consider voting for CLOUD-6498 to show your interest in official support.
Importantly, in this approach, we skip downloading the created site backups to any local machine simply because it's better than nothing. It is recommended to download site-backups if you can. To do so, use the bash scripts listed below:
Create and encode the API token
Create an API token using your site-admin account at https://id.atlassian.com/manage/api-tokens
Encode your credentials "$EMAIL_ADDRESS:$API_TOKEN" using base64
Consider using an online tool like Base64 Encode
Make sure not to include a line break at the end of your API string.
base64 encoding example
1
2
3
$ echo -n "site-admin@example.com:123e4567-e89b-12d3-a456-426614174000" | base64
c2l0ZS1hZG1pbkBleGFtcGxlLmNvbToxMjNlNDU2Ny1lODliLTEyZDMtYTQ1Ni00MjY2MTQxNzQw
MDA=
Create an automation rule for Confluence backup
Although you can start with either Jira or Confluence, we'll look into how to configure a rule for Confluence first.
Please refer to Create automation rules in Confluence for basic instructions on Confluence automation.
Step 1: Set up the schedule
Add the content below to Cron expression
For When rule executes, select "simply run the conditions and actions without providing issues"
1
0 0 19 1/3 * ?
Step 2: Add an action - Send web requests
Webhook URL: {{baseUrl}}/wiki/rest/obm/1.0/runbackup
Headers: Authorization: Basic <The base64 encoded output we got above>
Add another action - Log action
To be able to keep track of what we got with the webhook request, specify {{webhookResponse}} in Log message
Name the rule "Site backup - Confluence Cloud" and save the setting
Do a test run with [Run rule] button
The log then will be available in the Audit log
Check the backup download link
Cron expression
Each backup should be performed after a 48-hour interval at least. We are going to schedule the execution twice a week on Monday and Thursday. Also, make sure to avoid maintenance windows for your site.
For example, suppose your Cloud site maintenance is based on EST. We'll want to specify 9 am in UTC:
1
0 0 9 ? * 1,4
Webhook body
1
{"cbAttachments":"true"}
Create a rule for Jira site backup
In Jira, there are only a few details different from Confluence. Please refer to our documentation Create and edit Jira automation rules for basic Automation instructions.
Schedule - same as our Confluence example
Action - Send web request
Webhook URL: {{baseUrl}}/rest/backup/1/export/runbackup
Remaining procedures - same as our Confluence example
You can also find more detailed steps on how to perform this action on the following Community article:
Cron expression
Same here, the backup will run on Monday and Thursday at 9 am in UTC:
1
0 0 9 ? * 1,4
Webhook body
1
{"cbAttachments":"true", "exportToCloud":"true"}
A few things to be aware of
Jira has an upper bound on rule executions per subscription plan
That means you will not get a backup if exceed the limit. So consider upgrading to Premium, especially if you already have a respectable number of existing global automation rules.
The backup link will be available for 14 days for Jira and 7 days for Confluence
The link then will be replaced by the subsequent one. That means you will only be able to retrieve the backup file until the next backup ends. So make sure to download the backup file as soon as you find any data loss; otherwise, the backup link will be replaced with the one taken after the data loss.
For those using IP Allowlisting, include the egress IP ranges introduced at IP addresses and domains for Atlassian cloud products #Outgoing Connections
The steps from this documentation are originally from the following article in Atlassian Community: Automate online site-backups for Jira and Confluence without programming
If you have questions or suggestions, feel free to add a comment in the community article.
Was this helpful?