# Can we import one elastic search cluster data into another?

**URL:** https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529
**Category:** Elasticsearch
**Created:** [March 24, 2022, 7:44am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529 "2022-03-24T07:44:21Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)
#### Post date: [March 24, 2022, 7:44am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/1 "2022-03-24T07:44:22Z")

</div>

We have two different clusters created on Elasticsearch server

1. cluster 6.8
2. cluster 7.10

Just wanted to check is there any way to import data from one cluster to another? If yes, what are the ways to do it without re-indexing?

---

<div class="post-metadata">

### Author: ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)
#### Post date: [March 24, 2022, 7:52am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/2 "2022-03-24T07:52:58Z")

</div>

snapshot

---

<div class="post-metadata">

### Author: ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)
#### Post date: [March 24, 2022, 7:56am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/3 "2022-03-24T07:56:06Z")

</div>

is this the best and recommended option for importing data from cluster 6.8 to another version 7.10?

---

<div class="post-metadata">

### Author: ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)
#### Post date: [March 24, 2022, 8:10am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/4 "2022-03-24T08:10:04Z")

</div>

I think the ranking is as follows：

1. snapshot
2. CCR
3. The other mess is reindex(scroll bulk)

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [March 24, 2022, 8:12am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/5 "2022-03-24T08:12:27Z")

</div>

As you explicitely wrote 'without reindexing', the only way would be snapshots - you need to be sure, that the data within the snapshots however has not been written with Elasticsearch version 5.

If reindexing is an option, then you can [reindex from remote](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/docs-reindex.html#reindex-from-remote) to retrieve data from another cluster.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [March 24, 2022, 8:13am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/6 "2022-03-24T08:13:14Z")

</div>

You can use snapshot and restore to copy indices from 6.8 to 7.10 (as long as they were created in version 6.x), but moving data the other way will require reindexing as 7.10 indices can not be read by 6.8.

---

<div class="post-metadata">

### Author: ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)
#### Post date: [March 24, 2022, 8:37am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/7 "2022-03-24T08:37:52Z")

</div>

Thanks @spinscale and @Christian_Dahlqvist for the information.  
Current running Elasticsearch cluster is 6.8 and we wanted to switch to 7.10.2  
before switching to 7.10.2 cluster we need all the data from 6.8 to 7.10.2 cluster.

In my case there should not be problem with snapshots option.. correct?  
Is there any step by step guide/documentation around snapshots?

---

<div class="post-metadata">

### Author: ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)
#### Post date: [March 24, 2022, 12:40pm UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/8 "2022-03-24T12:40:50Z")

</div>

> [@spinscale](#):
>
> [reindex from remote](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/docs-reindex.html#reindex-from-remote)

If we want to go with this option [reindex from remote](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/docs-reindex.html#reindex-from-remote) then where we need to exactly pass source and destination urls( diff cluster url)

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [March 24, 2022, 1:07pm UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/9 "2022-03-24T13:07:13Z")

</div>

There is an example right in the linked docs. Please take a look

---

<div class="post-metadata">

### Author: ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)
#### Post date: [March 24, 2022, 1:36pm UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/10 "2022-03-24T13:36:15Z")

</div>

Yes ... I was going through it . I can see source URL but not destination URL

```auto
POST _reindex
{
  "source": {
    "remote": {
      "host": "http://otherhost:9200",
      "username": "user",
      "password": "pass"
    },
    "index": "my-index-000001",
    "query": {
      "match": {
        "test": "data"
      }
    }
  },
  "dest": {
    "index": "my-new-index-000001"
  }
}

```

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [March 24, 2022, 2:07pm UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/11 "2022-03-24T14:07:48Z")

</div>

You run this on the destination cluster and it reindexes from the specified source cluster.

---

<div class="post-metadata">

### Author: ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)
#### Post date: [March 24, 2022, 2:10pm UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/12 "2022-03-24T14:10:31Z")

</div>

> [@Prashant\_Kamble](#):
>
> ```auto
> "query": {
> "match": {
> "test": "data"
> }
> 
> ```

Okay .... below part is optional correct?

```auto
"query": {
      "match": {
        "test": "data"
      }

```

---

<div class="post-metadata">

### Author: ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)
#### Post date: [March 25, 2022, 7:23am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/13 "2022-03-25T07:23:21Z")

</div>

When we migrating indices from old cluster to new cluster then what if mapping is different from source index and destination index?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [March 25, 2022, 8:03am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/14 "2022-03-25T08:03:50Z")

</div>

Then you need to reindex, as restoring a snapshot would move the whole index including mappings.

---

<div class="post-metadata">

### Author: ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)
#### Post date: [March 25, 2022, 9:14am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/15 "2022-03-25T09:14:48Z")

</div>

> [@Prashant\_Kamble](#):
>
> [reindex from remote](https://www.elastic.co/guide/en/elasticsearch/reference/8.1/docs-reindex.html#reindex-from-remote)

Thanks. I was trying this reindex option but not sure about port of source&destination cluster so getting this exception

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "x_content_parse_exception",
        "reason" : "[8:3] [reindex] failed to parse field [source]"
      }
    ],
    "type" : "x_content_parse_exception",
    "reason" : "[8:3] [reindex] failed to parse field [source]",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "[host] must be of the form [scheme]://[host]:[port](/[pathPrefix])? but was [https://{url}]",
      "caused_by" : {
        "type" : "u_r_i_syntax_exception",
        "reason" : "The port was not defined in the [host]: https://{url}"
      }
    }
  },
  "status" : 400
}

```

Not sure how to find port number .... is this mandatory??

---

<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: [April 22, 2022, 9:15am UTC](https://discuss.elastic.co/t/can-we-import-one-elastic-search-cluster-data-into-another/300529/16 "2022-04-22T09:15:32Z")

</div>

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