How to back up and restore

This guide shows how to create backups (snapshots) of a Charmed OpenSearch cluster, restore from a backup, and migrate data to a new cluster.

Prerequisites

  • A cluster with at least three nodes deployed and active

  • Access to S3-compatible or Azure storage (see Configure S3 or Configure Azure storage)

  • Storage integration already established with OpenSearch

Note

Google Cloud Storage (GCS) is also supported. Charmed OpenSearch can back up to and restore from GCS through the gcs-integrator charm (source):

juju deploy gcs-integrator --channel 1/stable
juju integrate gcs-integrator opensearch

A dedicated configuration page for GCS is in progress. In the meantime, configure gcs-integrator as described in its documentation; once it is integrated with OpenSearch, the backup and restore flow on this page is identical to S3 and Azure.

Save cluster credentials

Backups exclude the security configuration, so the source cluster’s users, passwords, and role mappings cannot be restored. Before you run a restore or migrate to a new cluster, save the admin password and the CA certificates of the target cluster:

juju run opensearch/leader get-password

Caution

Excluding the security configuration does not protect the data itself. The snapshot repository still contains all indexed application data in an unencrypted form. Anyone with access to the repository can register it in another compatible OpenSearch cluster and restore that data using their own cluster’s admin credentials. Protect the repository with strict access controls and encryption at rest.

Create a backup

Confirm the cluster is active and idle with juju status, then run:

juju run opensearch/leader create-backup
Output example
backup-id: "2026-01-01t10:30:00z"
status: in_progress

The action only initiates the snapshot; it does not wait for it to finish. To confirm completion:

  1. Record the backup-id returned by the action.

  2. Run list-backups.

  3. Repeat until that backup-id shows a success status.

Track the backup by its backup-id, not by position in the list: other snapshots can be created directly through the OpenSearch API, so the newest entry is not necessarily yours.

Caution

Never restore or migrate a backup that is in_progress or failed. Only a success backup is complete and safe to use.

List backups

To list available, failed, and in-progress backups:

juju run opensearch/leader list-backups
Output example
backup-id            | backup-status
-------------------------------------
2026-01-01t10:30:00z | in_progress
2026-01-01t10:00:00z | success
2026-01-01t09:00:00z | failed

Restore a backup

To restore a backup that was made from a different cluster (cluster migration), see Migrate to a new cluster below.

To restore from the same cluster, pass the backup-id from list-backups:

juju run opensearch/leader restore backup-id=<backup-id>

After the restore completes, juju status shows the OpenSearch application active and the cluster health API returns green.

Note

If the restore takes longer than the Juju CLI timeout, it continues in the background. Monitor progress with juju status.

Migrate to a new cluster

To migrate data from one cluster to another, configure the new cluster to use the same storage backend where the old cluster’s backups reside, then restore:

juju run opensearch/leader restore backup-id=<backup-id>

The <backup-id> must reference a backup created by the previous cluster.

Next steps