Atlassian OnDemand (the low-priced, managed cloud-offering for JIRA and/or Confluence) had the functionality to do backups via self-service for quite a while. Before the introduction of this “Backup Manager” functionality, backups (aside from the ones done by Atlassian internally of course) were only available through the tedious process of opening a support ticket.
What’s still missing though (for almost a year now) is the functionality to automate this process using an API as well as a really reliable way of actually downloading the backups created by the Backup Manager.
Both can be fixed with a little bit of scripting of course. Looking closer at the HTTP requests happening when you actually click on the “Create Backup” button reveals that something akin to an API already exists: a POST request to a subpath/obm/1.0/runbackup
.
There are three unfortunate caveats to using this API though:
- You need to store the credentials of an administrator along with the backup scripts in order to obtain a cookie for performing the request. Relying on a cookie obtained by an interactive session would make this unnecessary but would still be insecure (it might also open another can of worms when the cookie becomes invalid at some point in the future).
- There is a backoff period at least for JIRA backups which can go as high as 48h. Apparently backups are (still) an expensive operation.
- You have to poll for the result - there is not really a convenient way to get notified about the completion of a successful backup. In practice you can probably get away with simply waiting for a fixed amount of time before attempting to download the backup. Our backup sizes are typically in the range of ~1.2 GB and we wait 15m before polling for a result.
These factors aside you can use the script today to automate your Atlassian OnDemand backups. Questions? Ask the Atlassian Experts!