Breadcrumbs

Automatic Backup: Backup via the API endpoint

Backing up Snapshots metadata can also be done via an API endpoint.

With this endpoint, you can, for example, include the snapshots backup in your automatic backups of the platform itself.

For explanation about the scope and purpose of snapshots backup, check out Backup and Restore, and Migration Between Sites .
The backup file will be suitable for restoration on Cloud.

image-20250814-155406.png

Follow these steps:

  1. Under Confluence Administration

  2. Navigate to Manage Apps → Snapshots of Jira data into Confluence → Backup, Restore, and Site to Site Migration

  3. Under the tab ‘API setting’:

    1. Enable the API

    2. Retrieve the Web request URL and the generated key. In the snippet below, these will be designated as <WEB REQUEST URL> and <API KEY>

How to retrieve the backup zio via the API

Retrieving the backup zip file, requires this sequence:

  1. Trigger a new task to create the backup file:

    1. POST <WEB REQUEST URL> migration-api-key: <API KEY>
      
    2. The response will include the <TASK ID> (which you will need at the next step)

  2. Check the status of the task, until its completed:

    1. POST <WEB REQUEST URL>?taskId=<TASK ID> migration-api-key: <API KEY>
      
  3. When the task is completed, the response includes the download url.

  4. Download the resulting zip

    1. GET <DOWNLOAD URL> migration-api-key: <API KEY>
      

Here is a snippet that shows a complete sequence:

dd@dd-Mac-mini ~ % curl -X POST -H "Content-Type: application/json" -H "migration-api-key: xx-b6be-41d7-ad99-a3ddaea163ea" https://xx-snapshots-test-frankfurt.ey.r.appspot.com/migration-backup
{"taskId":"prepare-for-migration-backup-task-ffc1236a-feed-42fd-9c02-b9ea5378bf9f","status":"IN_PROGRESS","downloadUrl":""}%                                                                                                           rina@Rinas-Mac-mini ~ % 

dd@dd-Mac-mini ~ % curl -X POST -H "Content-Type: application/json" -H "migration-api-key: xx-b6be-41d7-ad99-a3ddaea163ea" "https://xx-snapshots-test-frankfurt.ey.r.appspot.com/migration-backup?taskId=prepare-for-migration-backup-task-ffc1236a-feed-42fd-9c02-b9ea5378bf9f"
{"taskId":"prepare-for-migration-backup-task-ffc1236a-feed-42fd-9c02-b9ea5378bf9f","status":"READY","downloadUrl":"http://default-2-dot-snapshots-test-frankfurt.ey.r.appspot.com/migration-backup?taskId=prepare-for-migration-backup-task-ffc1236a-feed-42fd-9c02-b9ea5378bf9f-result"}%                                                                                                                                                                                    rina@Rinas-Mac-mini ~ % curl -X  GET  -H "migration-api-key: 950d3699-b6be-41d7-ad99-a3ddaea163ea" "http://default-2-dot-snapshots-test-frankfurt.ey.r.appspot.com/migration-backup?taskId=prepare-for-migration-backup-task-ffc1236a-feed-42fd-9c02-b9ea5378bf9f-result" 
Warning: Binary output can mess up your terminal. Use "--output -" to tell 
Warning: curl to output it to your terminal anyway, or consider "--output 
Warning: <FILE>" to save to a file.

dd@dd-Mac-mini ~ % curl -X  GET  -H "migration-api-key: xx-b6be-41d7-ad99-a3ddaea163ea" "http://xx-snapshots-test-frankfurt.ey.r.appspot.com/migration-backup?taskId=prepare-for-migration-backup-task-ffc1236a-feed-42fd-9c02-b9ea5378bf9f-result" --output downloadxx.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1198  100  1198    0     0   2925      0 --:--:-- --:--:-- --:--:--  2929