Download large Jira backup files using cURL
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
When a Jira backup file is too large, downloading it from UI may fail due to network timeouts.
This article describes alternative methods of downloading big Jira backup files using curl, wget or a download manager.
Environment
Cloud
Solution
- Get the backup fileID from the UI by hovering over the already generated backup. Right-click on the link => Copy link address => Copy it to a notepad to fetch the unique file id.
Using curl
Execute the following command by replacing:
- <name_your_backup> with the desired name for your backup file
- <CLOUD-URL> : replace with your Atlassian URL ( i.e. mysite.atlassian.net)
- <mediaID> : the fileID obtained in the previous step from the url;
- <USER-EMAIL> : your user's email address;
- <USER-API-TOKEN> : The API token you have generated as described in https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/
- --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.
Linux:
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>
Windows:
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 have executed the curl command
Using wget
Downloading with wget is suitable for the situations when the network is slow or it gets disrupted frequently.
Execute the following command by replacing:
- <name_your_backup> with the desired name for your backup file
- <CLOUD-URL> : replace with your Atlassian URL ( i.e. mysite.atlassian.net)
- <mediaID> : the fileID obtained in the previous step from the url;
- <USER-EMAIL> : your user's email address;
- When the password is asked, insert your API Token (to generate the API Token please follow https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/ )
wget -c -O '<name_your_backup.zip>' --auth-no-challenge --user=<USER-EMAIL> --ask-password 'https://<CLOUD-URL>/plugins/servlet/export/download/?fileId=<mediaID>'