---
title: Charmhub | Deploy Opensearch K8S using Charmhub - The Open Operator Collection
description: Deploy the latest version of Opensearch K8S as a Kubernetes Operator
  on any cloud.
url: https://charmhub.io/opensearch-k8s/docs/h-migrate-cluster
---

# Opensearch K8S

[Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

* [Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

Platform:

2/edge 22

```
juju deploy opensearch-k8s --channel 2/edge
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

All commands are written for `juju v.3.1.7+`

# How to migrate to a new cluster via restore

This is a guide on how to restore a backup that was made from a different cluster, (i.e. cluster migration via restore).

To perform a basic restore (from a local backup), see [How to restore a local backup](https://charmhub.io/opensearch-k8s/docs/h-restore-backup).

## [Prerequisites](https://charmhub.io/opensearch-k8s/docs/h-migrate-cluster#p-31542-prerequisites)

Restoring a backup from a previous cluster to a current cluster requires:

* At least 3x Charmed OpenSearch units deployed and running
* Access to an S3-compatible storage
* Configured settings for the S3-compatible storage
* Backups from the previous cluster in your S3-compatible storage

---

## [List backups](https://charmhub.io/opensearch-k8s/docs/h-migrate-cluster#p-31542-list-backups)

To view the available backups to restore, use the command `list-backups`:

```
juju run opensearch/leader list-backups
Running operation 335 with 1 task
  - task 336 on unit-opensearch-0

Waiting for task 336...
backups: |2-
   backup-id           | backup-status
  ------------------------------------
  2024-04-25T21:09:38Z | success
  2023-12-08T21:16:26Z | success
```

## [Restore backup](https://charmhub.io/opensearch-k8s/docs/h-migrate-cluster#p-31542-restore-backup)

To restore your current cluster to the state of the previous cluster, run the `restore` command and pass the correct `backup-id` (from the previously returned list) to the command:

```
juju run opensearch/leader restore backup-id="2024-04-25T21:16:26Z"
Running operation 339 with 1 task
  - task 340 on unit-opensearch-0

Waiting for task 340...
backup-id: "2024-04-25T21:16:26Z"
closed-indices: '{''.opensearch-sap-log-types-config'', ''series_index'', ''.plugins-ml-config''}'
status: Restore is complete
```

Your backup has been restored.

If the restore takes too long, the Juju CLI above will time out but the `juju status` command will provide a view if the charm is still running the restore action or not.

---
