# Restore to a different cluster

**URL:** <https://discuss.elastic.co/t/restore-to-a-different-cluster/322357>\
**Category:** Elasticsearch\
**Created:** [January 3, 2023, 9:32am UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357 "2023-01-03T09:32:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [January 3, 2023, 9:32am UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357/1 "2023-01-03T09:32:43Z")

</div>

Hi,

Good day!

I have a Production Environment (3 Nodes) and a DR Environment (3 Nodes). I received the error "snapshot does not exist" on the DR Environment after trying to restore the snapshot of the Production on the DR Environment. These are the steps I executed before restoring:

1. Registered a repository named "backup" on the Production and DR Environment
2. Created a snapshot of the Production Environment

H

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 3, 2023, 10:25pm UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357/2 "2023-01-03T22:25:03Z")

</div>

It'd be good if you shared the exact steps you used here, ie the commands you used.

---

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [January 4, 2023, 12:58am UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357/3 "2023-01-04T00:58:24Z")

</div>

Hi @warkolm, here

1. Registered the repository in the Production Environment

```auto
curl -k -u elastic:admin123 -X PUT 'https://esnode1.localdomain:9200/_snapshot/my-app-backup' -H 'Content-Type: application/json' -d'
{
  "type": "fs",
  "settings": {
    "compress": "true",
    "location": "/mnt/backup"
  }
}
'

```

1. Registered the repository in the DR Environment

```auto
curl -k -u elastic:admin123 -X PUT 'https://dresnode1.localdomain:9200/_snapshot/my-app-backup' -H 'Content-Type: application/json' -d'
{
  "type": "fs",
  "settings": {
    "compress": "true",
    "location": "/mnt/backup"
  }
}
'

```

1. Verified if the repository has been created in the Production Environment

`curl -k -u elastic:admin123 -X POST 'https://esnode1.localdomain:9200/_snapshot/my-app-backup/_verify?pretty'`

1. Verified if the repository has been created in the DR Environment

curl -k -u elastic:admin123 -X POST '[https://dresnode1.localdomain:9200/\_snapshot/my-app-backup/\_verify?pretty](https://dresnode1.localdomain:9200/_snapshot/my-app-backup/_verify?pretty)'

1. Created a snapshot for the Production Environment

`curl -k -u elastic:admin123 -X PUT 'https://esnode1.localdomain:9200/_snapshot/my-app-backup/snapshot-01032023?wait_for_completion=true&pretty'`

1. Verified if the snapshot has been created in the Production Environment

`curl -k -u elastic:admin123 -X GET 'https://esnode1.localdomain:9200/_snapshot/my-app-backup/snapshot-01032023?pretty'`

1. Restore the snapshot of Production in the DR Environment

`curl -k -u elastic:admin123 -X POST 'https://dresnode1.localdomain:9200/_snapshot/my-app-backup/snapshot-01032023/_restore?wait_for_completion=true&pretty'`

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 4, 2023, 1:01am UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357/4 "2023-01-04T01:01:30Z")

</div>

Is `/mnt/backup` shared between both clusters?

---

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [January 4, 2023, 1:04am UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357/5 "2023-01-04T01:04:15Z")

</div>

Yes, `/mnt/backup` is mounted on each node of the cluster. I'm just simulating the Production and DR backup and restore using a virtual box.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 4, 2023, 1:11am UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357/6 "2023-01-04T01:11:11Z")

</div>

Right but is the filesystem the same for both, not just the same mount but you can actually see the files the snapshot has created on the prod cluster in the same mount on the dr cluster?

You also need to set the dr cluster to register the repo as read only, as [per the docs](https://www.elastic.co/guide/en/elasticsearch/reference/8.5/snapshots-register-repository.html#snapshot-repo-considerations) (and more specifically [here](https://www.elastic.co/guide/en/elasticsearch/reference/8.5/snapshots-filesystem-repository.html)).

---

<div class="post-metadata">

**Author:** ![hjsroldan](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@hjsroldan](https://discuss.elastic.co/u/hjsroldan)\
**Post date:** [January 4, 2023, 2:15am UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357/7 "2023-01-04T02:15:51Z")

</div>

Thanks @warkolm, I successfully restored my cluster.

Also, index `.ds-ilm-history-5-2022.12.27-000001`, `.ds-.logs-deprecation.elasticsearch-default-2022.12.27-000001`, and `.security-7` has been created by elasticsearch after taking the snapshot of the Production. May I know if these are relevant indices that also need to be restored in the DR?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 4, 2023, 7:04am UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357/8 "2023-01-04T07:04:09Z")

</div>

Only if you want the same Security setup.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 1, 2023, 7:04am UTC](https://discuss.elastic.co/t/restore-to-a-different-cluster/322357/9 "2023-02-01T07:04:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
