Download large Confluence Cloud backup files using cURL or wget
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
Downloading large Confluence backup files from the UI may fail due to network timeouts. You can use curl
or wget
from the command-line interface (CLI) to download backup files instead.
Solution
Get the backup fileID
Assuming you have already generated a backup file and are ready to download it:
Navigate to Confluence Administration> Settings > Data Management > Backup manager.
Inspect the SiteBackup.zip link for your selected backup.
Copy the link destination.
Backup links look similar to:
https://<your_site>.atlassian.net/wiki/download/temp/filestore/<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.
<Base64_encodedstring>: Create a base64-encoded string that contains your Atlassian account email and API token by following the steps here: Supplying basic auth headers.
--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 added the "-C-" parameter to automatically resume the download if network instability interrupts it.
cURL on Linux or MacOS:
curl --location --output '<name_your_backup>.zip' --retry 450 -C - --request GET 'https://<your_site>.atlassian.net/wiki/download/temp/filestore/<backup_fileID>' --header "Authorization: Basic <Base64_encodedstring>"
cURL on Windows using Powershell:
curl --location --output "<name_your_backup>.zip" -C - --request GET "https://<your_site>.atlassian.net/wiki/download/temp/filestore/<backup_fileID>" --retry 450 --header "Authorization: Basic <Base64_encodedstring>"
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 the 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.
wget -c -O '<name_your_backup.zip>' --auth-no-challenge --user=<USER-EMAIL> --ask-password 'https://<your_site>.atlassian.net/wiki/download/temp/filestore/<backup_fileID>'
Was this helpful?