Download large Jira backup files using cURL or wget
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
When a Jira backup file is too large, downloading it from Jira's UI may fail due to network timeouts.
Jira backup files can also be downloaded using curl or wget. These methods should avoid the network timeouts.
When to use this: If downloading a large backup from the Jira UI fails with a network timeout, curl/wget on the command line avoids the browser timeout and lets the download resume or run unattended.
Solution
Steps at a glance:
1. Copy the backup download link - go to Settings > System > Backup manager,
right-click the Download cloud backup link, and copy the URL
(it looks like https://<site>.atlassian.net/plugins/servlet/export/download/?fileId=<id>)
2. Use an existing API token or generate a new one at https://id.atlassian.com/manage-profile/security/api-tokens
3. Run the command - use the curl or wget command below, substituting your
email, API token, fileId, and output filename
Detailed walkthrough below:
Get the backup fileID
Before you start, make sure you have: (1) an already generated backup file, (2) the backup file ID, and (3) an API token. Steps 1–2 below explain how to obtain each.
Assuming you have already generated a backup file and are ready to download it:
Navigate to Settings > System > Backup manager
Inspect the Download cloud backup link for your selected backup
Copy the link destination
Backup links look similar to:
https://<your_site>.atlassian.net/plugins/servlet/export/download/?fileId=<backup_fileID>
Paste the link in a notepad or other location where you can reference it later
Generate an API token
If you already have an API token, you can skip this step.
Otherwise, please follow the instructions to Create an API token in our documentation.
Get backup file with cURL
Execute the following cURL command by replacing:
<name_your_backup>: with the desired name for your backup file
<CLOUD-URL>: replace with your Atlassian URL ( for example,
mysite.atlassian.net)<mediaID>: the FileID obtained in the previous step from the Download cloud backup link
<USER-EMAIL>: your user's email address
<USER-API-TOKEN>: The API token you generated above
--retry Modify the retry parameter based on how large the file is and how unstable your connection is
In the command below, retry is set to 450
Also, note that we add the "--continue-at -" parameter to automatically resume if network instability interrupts the download. If the download is interrupted, re-run the exact same command in the same directory, "--continue-at" resumes from where it stopped rather than restarting.
cURL on Linux or MacOS:
curl --location --output '<name_your_backup>.zip' --retry 450 --continue-at - --request GET 'https://<CLOUD-URL>/plugins/servlet/export/download/?fileId=<mediaID>' --user <USER-EMAIL>:<USER-API-TOKEN>cURL on Windows using Powershell:
On Windows using PowerShell, invoke cURL through curl.exe.
curl --location --output "<name_your_backup>.zip" --continue-at - --request GET "https://<CLOUD-URL>/plugins/servlet/export/download/?fileId=<mediaID>" --retry 450 --user "<USER-EMAIL>:<USER-API-TOKEN>"NOTE: the backup file will be generated in the same location you execute the cURL command.
Get backup file with wget
wget is suitable for slow network connections, or when connection is disrupted frequently.
Execute the following wget command by replacing:
<name_your_backup>: with the desired name for your backup file
<CLOUD-URL>: replace with your Atlassian URL (for example, mysite.atlassian.net)
<mediaID>: the FileID obtained in the previous step from the url
<USER-EMAIL>: your user's email address
The "-c" flag lets wget continue a partially downloaded file if the connection drops. Re-run the same command to resume.
When prompted to enter a password, insert your API Token
wget -c -O '<name_your_backup.zip>' --auth-no-challenge --user=<USER-EMAIL> --ask-password 'https://<CLOUD-URL>/plugins/servlet/export/download/?fileId=<mediaID>'How do I know it worked?
The downloaded file size matches the backup size shown in Backup manager and the archive opens.
Was this helpful?