# Best way to copy very large index

**URL:** <https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685>\
**Category:** Elasticsearch\
**Created:** [November 22, 2017, 9:31am UTC](https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685 "2017-11-22T09:31:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![annaK](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@annaK](https://discuss.elastic.co/u/annaK)\
**Post date:** [November 22, 2017, 9:31am UTC](https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685/1 "2017-11-22T09:31:28Z")

</div>

Hi all,

just a short question regarding copying a very large index.  
The index has ca. 400,000,000 to 500,000,000 documents.

I tried it via \_reindex but here it took 30 minutes for 4,000,000 documents.  
Are there any methods to speed things up?

I am running on a elasticsearch version 5.2.2. 🙂

Regards  
Anna

---

<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:** [November 22, 2017, 9:32am UTC](https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685/2 "2017-11-22T09:32:58Z")

</div>

Are you looking to create a copy in the same cluster?

---

<div class="post-metadata">

**Author:** ![annaK](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@annaK](https://discuss.elastic.co/u/annaK)\
**Post date:** [November 22, 2017, 9:33am UTC](https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685/3 "2017-11-22T09:33:41Z")

</div>

Yes exactly 🙂

---

<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:** [November 22, 2017, 9:34am UTC](https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685/4 "2017-11-22T09:34:25Z")

</div>

I have done this in the past by creating a snapshot and then renaming the index as I restore it back. That will copy full segment files and should be faster than reindexing.

---

<div class="post-metadata">

**Author:** ![annaK](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@annaK](https://discuss.elastic.co/u/annaK)\
**Post date:** [November 22, 2017, 9:50am UTC](https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685/5 "2017-11-22T09:50:01Z")

</div>

ah okay, nice idea 🙂  
Do you have kind of a tutorial of how to do this? 🙂

---

<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:** [November 22, 2017, 9:57am UTC](https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685/6 "2017-11-22T09:57:56Z")

</div>

It is all covered in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html). The [second example under the restore section](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html#_restore) shows how you can rename the index you are restoring.

---

<div class="post-metadata">

**Author:** ![annaK](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@annaK](https://discuss.elastic.co/u/annaK)\
**Post date:** [November 22, 2017, 10:02am UTC](https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685/7 "2017-11-22T10:02:15Z")

</div>

Thank you very much! I will test this one 🙂

---

<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:** [December 20, 2017, 10:02am UTC](https://discuss.elastic.co/t/best-way-to-copy-very-large-index/108685/8 "2017-12-20T10:02:17Z")

</div>

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