# Restore elasticsearch cluster onto another cluster

**URL:** <https://discuss.elastic.co/t/restore-elasticsearch-cluster-onto-another-cluster/283238>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [September 3, 2021, 5:45am UTC](https://discuss.elastic.co/t/restore-elasticsearch-cluster-onto-another-cluster/283238 "2021-09-03T05:45:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![auto\_reply\_007](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@auto\_reply\_007](https://discuss.elastic.co/u/auto_reply_007)\
**Post date:** [September 3, 2021, 5:45am UTC](https://discuss.elastic.co/t/restore-elasticsearch-cluster-onto-another-cluster/283238/1 "2021-09-03T05:45:17Z")

</div>

Hello i have 3 node elasticsearch cluster ( source ) and i have snapshot called snapshot-1 which taken from source cluster and i have another 6 node elasticsearch cluster ( destination ) cluster

and when i restore my destinatition cluster from snapshot-1 using this command

```auto
curl -X POST -u elastic:321 "192.168.2.15:9200/snapshot/snapshot_repository/snapshot-1/_restore?pretty" -H 'Content-Type: application/json' -d'

> {
> "indices": "*",
> "ignore_unavailable": true,
> "include_global_state": false,
> "rename_pattern": ".security(.+)",
> "rename_replacement": "delete_$1",
> "include_aliases": false
> }
> '
{

```

and i got this error

```auto
"error" : {

"root_cause" : [

  {

    "type" : "snapshot_restore_exception",

    "reason" : "[snapshot:snapshot-1 yjg/mHsYhycHQsKiEhWVhBywxQ] cannot restore index [.ilm-history-0003] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"

  }

```

so as you can see the index .ilm-history-0003 already exists in the cluster, but how can i do rename replacement for security,.ilm,.slm,.transfrom indices using only 1 rename\_pattern? like this one

`"rename_pattern": ".security(.+)",`

---

<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:** [September 3, 2021, 5:48am UTC](https://discuss.elastic.co/t/restore-elasticsearch-cluster-onto-another-cluster/283238/2 "2021-09-03T05:48:42Z")

</div>

Welcome to our community! 😃

I don't believe that you can have multiple `rename_pattern` in there, so you can either have a global one that renames _all_ indices, or use [Multi-target syntax | Elasticsearch Guide [7.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.14/multi-index.html) to be a bit more explicit with your restored index names.

---

<div class="post-metadata">

**Author:** ![auto\_reply\_007](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@auto\_reply\_007](https://discuss.elastic.co/u/auto_reply_007)\
**Post date:** [September 3, 2021, 5:59am UTC](https://discuss.elastic.co/t/restore-elasticsearch-cluster-onto-another-cluster/283238/3 "2021-09-03T05:59:52Z")

</div>

hello! thank you !!  
so in this case i can use this pattern?

```auto
curl -X POST -u elastic:321 "192.168.2.15:9200/snapshot/snapshot_repository/snapshot-1/_restore?pretty" -H 'Content-Type: application/json' -d'

> {
> "indices": "*, -.slm,-,ilm,-.transfrom,-security",
> "ignore_unavailable": true,
> "include_global_state": false,
> "include_aliases": false
> }
> '
{

```

is this okay?

---

<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:** [September 3, 2021, 6:09am UTC](https://discuss.elastic.co/t/restore-elasticsearch-cluster-onto-another-cluster/283238/4 "2021-09-03T06:09:30Z")

</div>

Yep that should work.

---

<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:** [October 1, 2021, 8:07am UTC](https://discuss.elastic.co/t/restore-elasticsearch-cluster-onto-another-cluster/283238/6 "2021-10-01T08:07:06Z")

</div>

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