API - Download backup file

Backup Management
API Endpoint

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

Important: The username and password are the HTTP Auth credentials of your Opensolr Index, NOT your Opensolr account login. Each Opensolr Index is protected by HTTP Basic Auth over HTTPS.

If you have not changed them, the default credentials are:
Username: opensolr
Password: Your Secret API Key found in your Opensolr Dashboard

Parameters

ParameterStatusDescription
INDEX_NAMErequiredThe name of your Opensolr index (used in the URL path)
BACKUP_FILE_NAMErequiredThe backup file name. Get this from the List Backup Files API
usernamerequiredHTTP Basic Auth username for your index
passwordrequiredHTTP Basic Auth password for your index
Backup URL structure: 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