# Copy docs from one index to another index

**URL:** <https://discuss.elastic.co/t/copy-docs-from-one-index-to-another-index/34415>\
**Category:** Elasticsearch\
**Created:** [November 12, 2015, 1:05pm UTC](https://discuss.elastic.co/t/copy-docs-from-one-index-to-another-index/34415 "2015-11-12T13:05:17Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)\
**Post date:** [February 12, 2016, 4:46am UTC](https://discuss.elastic.co/t/copy-docs-from-one-index-to-another-index/34415/21 "2016-02-12T04:46:09Z")

</div>

Yeah @dadoonet I used kill command to stop the logstash.

But running logstash with **nohup ./bin/logstash -f logstash.conf &** will certainly avoid any network connectivity related problems. In my case what happened is Let's say if my old index (es\_item) has 20 million docs and tried to copy docs to new index(es\_item1), while running in background 20 million docs are copied to new index and again logstash doing copying the same docs with different versions and adding it to new index & docs count is keep on increasing and size of index becomes larger.

In that case only I want to know how to avoid this?

Please let us know your suggestions

**Note:-** Suppose If i execute logstash without nohup and during copying if any network problem occurs I am getting this error **"Network error: Software caused connection abort"** and after that logstash copying stops.

Thanks,  
Ganeshbabu R

---

<div class="post-metadata">

**Author:** ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)\
**Post date:** [February 23, 2016, 5:21am UTC](https://discuss.elastic.co/t/copy-docs-from-one-index-to-another-index/34415/22 "2016-02-23T05:21:14Z")

</div>

Hi @dadoonet,

I want to copy docs with from existing index to new index with filter and based on the filter condition docs should copy to new item index. The filter condition should be like,

1. In the existing index I have field called as "RGN\_ID" based on the RGN\_ID the item should copy docs from one index to another index.
2. Let's say For RGN\_id = 9 has the total docs count of 1,03,452 How to add the RGN\_ID in logstash conf filter condition?

Please let us know your suggestions and this is required for our workaround testing purpose.

Thanks,  
Ganeshbabu R

---

<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:** [July 5, 2017, 11:14pm UTC](https://discuss.elastic.co/t/copy-docs-from-one-index-to-another-index/34415/23 "2017-07-05T23:14:17Z")

</div>

Closed on July 5, 2017, 11:14pm UTC



[Previous page](https://discuss.elastic.co/t/copy-docs-from-one-index-to-another-index/34415.md?page=1)
