# What is the best way to copy Elasticsearch index to other server?

**URL:** <https://discuss.elastic.co/t/what-is-the-best-way-to-copy-elasticsearch-index-to-other-server/134088>\
**Category:** Elasticsearch\
**Created:** [May 31, 2018, 5:21pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-copy-elasticsearch-index-to-other-server/134088 "2018-05-31T17:21:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dolph\_2709](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@Dolph\_2709](https://discuss.elastic.co/u/Dolph_2709)\
**Post date:** [May 31, 2018, 5:21pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-copy-elasticsearch-index-to-other-server/134088/1 "2018-05-31T17:21:06Z")

</div>

I need to copy data from old ElasticSearch (v. 1.1.1) to other server running ver. 6.2.

I have no physical access to old server, but it doesn't have any security (X-Pack) installed, so I can easily navigate thru data with REST. I have full root access to destination server running ElasticSearch 6.2.

I'm really confused searching for answers, looks like too many ways to do it: (reindex, backup, elasticdump, etc).

What is the best way to do it?

The source server has single index with 16 different documents mapped, (so "manual" mapping would be complicated).

---

<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:** [May 31, 2018, 5:54pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-copy-elasticsearch-index-to-other-server/134088/2 "2018-05-31T17:54:27Z")

</div>

There has been a number of changes to types and mappings between these versions, so I would suspect you need to migrate mappings before you migrate data by reindexing it.

---

<div class="post-metadata">

**Author:** ![Dolph\_2709](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@Dolph\_2709](https://discuss.elastic.co/u/Dolph_2709)\
**Post date:** [June 1, 2018, 1:56pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-copy-elasticsearch-index-to-other-server/134088/3 "2018-06-01T13:56:29Z")

</div>

I'm currently investigating if I can use Logstash on destination server to pull data from old Elasticsearch.  
using something like this in Logstash config:

> input {  
> elasticsearch {  
> hosts =\> "[es.production.mysite.org](http://es.production.mysite.org)"  
> index =\> "mydata-2018.09._"  
> # query =\> '{ "query": { "query\_string": { "query": "_" } } }'  
> size =\> 500  
> scroll =\> "5m"  
> docinfo =\> true  
> }  
> }  
> output {  
> elasticsearch {  
> index =\> "copy-of-production.%{[@metadata][\_index]}"  
> document\_type =\> "%{[@metadata][\_type]}"  
> document\_id =\> "%{[@metadata][\_id]}"  
> }  
> }

But I still don't understand how to pull all 12 mil documents from source Elasticsearch. Would it be a right approach to run Logstash on schedule and somehow with a "smart query" to pull data piece by piece?  
Somehow if I use that config as is (with query line commented ) I always end up with 500 documents in destination index. I probably don't understand the "scroll" part.

---

<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:** [June 29, 2018, 1:56pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-copy-elasticsearch-index-to-other-server/134088/4 "2018-06-29T13:56:35Z")

</div>

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