API - Download backup file
Download Index Backup File
Download a backup file from the Opensolr backup servers. Backup files are accessed via HTTPS with your index HTTP Basic Auth credentials — not your Opensolr account credentials.
Endpoint
GET https://backup.opensolr.com/<INDEX_NAME>/<BACKUP_FILE_NAME>
Authentication
If you have not changed them, the default credentials are:
• Username:
opensolr• Password: Your Secret API Key found in your Opensolr Dashboard
Parameters
| Parameter | Status | Description |
|---|---|---|
INDEX_NAME | required | The name of your Opensolr index (used in the URL path) |
BACKUP_FILE_NAME | required | The backup file name. Get this from the List Backup Files API |
username | required | HTTP Basic Auth username for your index |
password | required | HTTP Basic Auth password for your index |
https://backup.opensolr.com/<INDEX_NAME> contains the latest backup of your index, plus daily backup archives from the last 10 days.Code Examples
cURL
curl -s -u "USERNAME:PASSWORD" -o backup.tar.gz \ "https://backup.opensolr.com/YOUR_INDEX/BACKUP_FILE_NAME"
PHP
$ch = curl_init('https://backup.opensolr.com/YOUR_INDEX/BACKUP_FILE_NAME'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_USERPWD => 'USERNAME:PASSWORD', ]); $data = curl_exec($ch); curl_close($ch); file_put_contents('backup.tar.gz', $data); echo "Backup saved to backup.tar.gz\n";
Python
import requests response = requests.get( "https://backup.opensolr.com/YOUR_INDEX/BACKUP_FILE_NAME", auth=("USERNAME", "PASSWORD"), stream=True ) with open("backup.tar.gz", "wb") as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk) print("Backup saved to backup.tar.gz")
Related Documentation
Create Backup
Create a new backup snapshot of your Opensolr index.
List Backup Files
Get a list of all available backup files for your index.
Backup Guide
Complete guide to Opensolr backups: enable, create, restore, and download.
Need help with backups or disaster recovery? We can help.
Contact Support