Download large Jira backup files using cURL or wget
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
When a Jira backup file is too large, downloading it from Jira's user interface may fail due to network timeouts.
We can also download Jira backup files using curl
or wget
on command line interfaces. These methods should avoid the network timeouts in Jira's UI.
Solution
Get the backup fileID
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 is set to 450
cURL on Linux or MacOS:
1
curl --location --output '<name_your_backup>.zip' --retry 450 --request GET 'https://<CLOUD-URL>/plugins/servlet/export/download/?fileId=<mediaID>' --user <USER-EMAIL>:<USER-API-TOKEN>
cURL on Windows using Powershell:
1
curl --location --output "<name_your_backup>.zip" --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
When prompted to enter a password, insert your API Token
1
wget -c -O '<name_your_backup.zip>' --auth-no-challenge --user=<USER-EMAIL> --ask-password 'https://<CLOUD-URL>/plugins/servlet/export/download/?fileId=<mediaID>'
Was this helpful?