Automate Jira/Confluence Cloud backups

Still need help?

The Atlassian Community is here for you.

Ask the community

Summary

This article provides a step-by-step guide for automating backups of Jira and Confluence Cloud through the use of global automation rules.

Background

  • Atlassian-generated backups are meant for Disaster recovery. We do not use these backups to reverse customer-initiated destructive changes, such as fields overwritten by scripts or deleted issues, projects, or sites. To prevent data loss, we recommend that you regularly create your own backups. These backups are essential for recovering data in the event of information loss due to user actions.

  • To maintain consistent backups for Jira and Confluence, it is recommended to implement a mechanism that automates or schedules backups at regular intervals, such as weekly, bi-weekly, or monthly.

  • At present, we don't offer a feature to automate backups for Jira and Confluence. However, the feature request CLOUD-6498 is already being considered.
  • With the introduction of the new backup and restore solution (available exclusively for Enterprise customers), automating backups for Jira and Confluence is now possible through Jira cloud automation.

Environment

  • This is applicable to Enterprise cloud customers.

Follow steps to automate backups

Create a backup policy for your product

  1. Follow create a backup policy for detailed instructions.

  2. Once the backup policy is created, click on view details, which will show the details of the policy created. Note the policy ID in the HTTP request. It would be like below

    https://admin.atlassian.com/o/<org id>/data-management/backup-and-restore/policy/policy-details/<policy id>/?pageSize=20&start=0&tab=backups

Create the Jira Automation rule

  1. Navigate to [Settings > System > Global automation] For example, Go to https://<cloud instance name>.atlassian.net/jira/settings/automation to add a rule.

  2. Create a new automation rule.

  3. Add a Scheduled component and set the frequency of your backup. You can set the frequency of your choice. Remember, as mentioned in backup and restore limitations “You can run one backup once every 7 days”  


Send web request POST API call

  1. Add Send web request POST API call. We need to pass the below parameter values. 

    ParameterValue
    Web request URLhttps://api.atlassian.com/public/backup-management/v1/orgs/<org_id>/backups
            replace ord_id with your organization ID
    HTTP MethodPOST
    Web request bodyCustom
    Body
    {  "policyId": "xxxx-0f03-45e6-9c48-1e181b0a28ae",  
    "cloudId": "xxxx-2637-4d79-a9e0-xxxx"
    }
    Headers

    Accept > application/json

    Authorization : Basic <encoded64 API token>

  2.  To pass authorization token :

    1. Issue an API token of the site-admins account at https://id.atlassian.com/manage/api-tokens

    2. Encode your credentials “<EMAIL>:<API_TOKEN>” with base64 as (1-2) Example below. Or go with any online tool like Encode/Decode Make sure not to include a line break at the end.
      You can refer below command to generate encoded 64 token 

       $ echo -n "site-admin@example.com:123e4567-e89b-12d3-a456-426614174000" | base64
       
      Output :c2l0ZS1hZG1pbkBleGFtcGxlLmNvbToxMjNlNDU2Ny1lODliLTEyZDMtYTQ1Ni00MjY2MTQxNzQwMDA=


Create an Email Notification for backup report

  1. Add an Email component to send out Notifications for backup report.
    • We are sharing reference content for Email body. You can refer “Send web request component” > How do I access web request response values in subsequent rule actions” section for more details. 
      > Status: {{webResponse.status}}
      
      > Category: {{webResponse.statusCategory}} 
      
      > Headers: {{webResponse.headers}} 
      
      > Type: {{webResponse.headers.Content-Type}}
      
      > Body: {{webResponse.body}} 
      
      > Body Name: {{webResponse.body.name}}
      


  2. Save the rule. You can test the rule using “Run rule” option available at top right corner. You can check "audit rule" section for all executions of this rule. 


References

Last modified on Feb 4, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.