Skip to main content

Backups in an OpenSearch cluster

OpenSearch cloud databases automatically create index backups. You do not need to configure and monitor backups yourself.

OpenSearch built-in snapshot mechanism is used to create index backups. A snapshot is a snapshot of the current state of indexes with data. For more details about snapshot mechanism see Take and restore snapshots in OpenSearch documentation.

Backups are created incrementally:

  • the first backup contains a complete copy of all data;
  • all subsequent backups contain only the changes since the previous successful backup.

From backups, you can restore indexes only in the cluster in which they were created. Index backups are not stored after a cluster is deleted. You cannot restore a cluster or create a new one from index backups of a deleted cluster.

Backups are stored in isolation from other users' backups.

Backups cannot be uploaded. Automatic creation of backups cannot be disabled.

Backup schedule

Index backups are created once every 30 minutes.

Backup retention period

Index backups are stored for 7 days.

Restore indexes from backup

You can restore indexes from backups through the OpenSearch API or the OpenSearch Dashboards web interface. You cannot restore system indexes that contain global state and cluster settings, such as .opendistro_security.

  1. Get the date and time of creation of the backup from which you want to restore indexes. To do this, output the list of backups:

    curl -XGET -u 'admin:<password>' \
    --cacert ~/.opensearch/root.crt \
    'https://<ip_address>:<port>/_cat/snapshots/dbaas-repo'

    Specify:

    • <password> — password of the admin user;
    • <ip_address> — IP address of the node;
    • <port> — port for connection.

    A list of backups will appear in the response. Copy from the backup name the date and time of its creation — they are specified in the format yyyyyymmdd-hh-mm. For example:

    dbaas-snapshot-20250928-09-48 SUCCESS 1759052881 09:48:01 1759052883 09:48:03  1.8s 5 5 0 5
    dbaas-snapshot-20250928-10-18 SUCCESS 1759054681 10:18:01 1759054682 10:18:02 600ms 5 5 0 5
    dbaas-snapshot-20250928-10-48 SUCCESS 1759056481 10:48:01 1759056482 10:48:02 600ms 5 5 0 5

    Here 20250928-09-48, 20250928-10-18, and 20250928-10-48 are the date and time the backups were created.

  2. Get the names of the indexes to be restored. To do this, output the information about the backup:

    curl -XGET -u 'admin:<password>' \
    --cacert ~/.opensearch/root.crt \
    'https://<ip_address>:<port>/_snapshot/dbaas-repo/dbaas-snapshot-<timestamp>?pretty'

    Specify:

    • <password> — password of the admin user;
    • <ip_address> — IP address of the node;
    • <port> — port for connection;
    • <timestamp> — the date and time of backup creation that you got in step 1.

    In the indices field, copy the names of the indexes to be restored.

  3. Check if there are any open indexes in the cluster with the same names you want to restore. To do this, print information about all open indexes:

    curl -XGET -u 'admin:<password>' \
    --cacert ~/.opensearch/root.crt \
    'https://<ip_address>:<port>/_cat/indices?v&h=index,health,status,docs.count,store.size&s=index&expand_wildcards=open,hidden'

    Specify:

    • <password> — password of the admin user;
    • <ip_address> — IP address of the node;
    • <port> — port for connection.

    The names of the indexes will be specified in the index field.

  4. If there are already open indexes in the cluster with the same names you want to restore, delete them. You cannot duplicate open index names in an OpenSearch cluster.

    curl -XDELETE -u 'admin:<password>' \
    --cacert ~/.opensearch/root.crt \
    'https://<ip_address>:<port>/<index>'

    Specify:

    • <password> — password of the admin user;
    • <ip_address> — IP address of the node;
    • <port> — port for connection;
    • <index> — name of the index to delete. If you need to specify multiple indexes, separate them with a comma.
  5. Restore the indexes:

    curl -XPOST -u 'admin:<password>' --cacert ~/.opensearch/root.crt 'https://<ip_address>:<port>/_snapshot/dbaas-repo/dbaas-snapshot-<timestamp>/_restore' \
    -H 'Content-Type: application/json' \
    -d '{
    "indices": "<index>",
    "include_global_state": false
    }'

    Specify:

    • <password> — password of the admin user;
    • <ip_address> — IP address of the node;
    • <port> — port for connection;
    • <timestamp> — the date and time of backup creation that you got in step 1;
    • <index> — name of the index to be restored. If you need to specify multiple indexes, separate them with a comma.