# How can I swap indexes?

**URL:** <https://discuss.elastic.co/t/how-can-i-swap-indexes/2364>\
**Category:** Elasticsearch\
**Created:** [June 10, 2015, 6:05pm UTC](https://discuss.elastic.co/t/how-can-i-swap-indexes/2364 "2015-06-10T18:05:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick99e99](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick99e99/32/609_2.png) [@patrick99e99](https://discuss.elastic.co/u/patrick99e99)\
**Post date:** [June 10, 2015, 6:05pm UTC](https://discuss.elastic.co/t/how-can-i-swap-indexes/2364/1 "2015-06-10T18:05:00Z")

</div>

Hi everyone. I am working on an application that has an extremely large production database. On occasion, I need to test things locally with real data, so I during these times, I switch to a copy of my production database. The problem is, my local environment elasticsearch does not have this data indexed, and doing this indexing takes a long time.

I would like a way to easily be able to switch between indexes from my regular development database, and my cloned production database. I was wondering if anyone knows where the index file is stored and if this could be just as simple as moving files back and forth?

Thanks!

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [June 10, 2015, 6:19pm UTC](https://discuss.elastic.co/t/how-can-i-swap-indexes/2364/2 "2015-06-10T18:19:29Z")

</div>

Maybe the snapshot/restore feature would be better here. You could just index them both and leave the one you don't want to work with closed but I understand if you want to be super careful about not deleting it.

---

<div class="post-metadata">

**Author:** ![andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@andrew](https://discuss.elastic.co/u/andrew)\
**Post date:** [June 10, 2015, 7:03pm UTC](https://discuss.elastic.co/t/how-can-i-swap-indexes/2364/3 "2015-06-10T19:03:48Z")

</div>

Have you tried using aliases?

Have you had a look at: [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html) ?

Andrew

---

<div class="post-metadata">

**Author:** ![patrick99e99](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick99e99/32/609_2.png) [@patrick99e99](https://discuss.elastic.co/u/patrick99e99)\
**Post date:** [June 10, 2015, 9:32pm UTC](https://discuss.elastic.co/t/how-can-i-swap-indexes/2364/4 "2015-06-10T21:32:15Z")

</div>

Hi Andrew,

Thanks for the alias suggestion...

Another thing I want to be able to do is make this accessible to other members on my team.. So that's why I was hoping there was just some elastic search file somewhere that could be copied to multiple computers so that anyone using this production copy would be able to instantly have an elastic search index to use... ?

---

<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 6, 2017, 12:08am UTC](https://discuss.elastic.co/t/how-can-i-swap-indexes/2364/5 "2017-07-06T00:08:26Z")

</div>


