# Rename index name

**URL:** <https://discuss.elastic.co/t/rename-index-name/94303>\
**Category:** Elasticsearch\
**Created:** [July 24, 2017, 10:16am UTC](https://discuss.elastic.co/t/rename-index-name/94303 "2017-07-24T10:16:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![natsudragoneye](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@natsudragoneye](https://discuss.elastic.co/u/natsudragoneye)\
**Post date:** [July 24, 2017, 10:16am UTC](https://discuss.elastic.co/t/rename-index-name/94303/1 "2017-07-24T10:16:35Z")

</div>

I rebuilding a index. When I finish the rebuilding, I need to rename it.  
How can i do that using NEST v5.4?

Thanks in advance!

**EDIT!**  
You can check the solution here: [SOLUTION](https://stackoverflow.com/questions/45266969/reindexing-using-nest-v5-4-elasticsearch)

---

<div class="post-metadata">

**Author:** ![Prashant\_Agrawal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_agrawal/32/74982_2.png) [@Prashant\_Agrawal](https://discuss.elastic.co/u/Prashant_Agrawal)\
**Post date:** [July 24, 2017, 10:19am UTC](https://discuss.elastic.co/t/rename-index-name/94303/2 "2017-07-24T10:19:59Z")

</div>

As such there is no direct method to rename index in ES (I did search extensively for my own project). Rather you can do the re-index to different name and then delete old one.

Refer this : [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)

and if you can't REINDEX a workaround is to use aliases. [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html)

---

<div class="post-metadata">

**Author:** ![natsudragoneye](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@natsudragoneye](https://discuss.elastic.co/u/natsudragoneye)\
**Post date:** [July 24, 2017, 10:27am UTC](https://discuss.elastic.co/t/rename-index-name/94303/3 "2017-07-24T10:27:05Z")

</div>

First of all thanks for your answer.

I already try using Re-index. I check this [EXAMPLE] ([http://thomasardal.com/elasticsearch-migrations-with-c-and-nest/](http://thomasardal.com/elasticsearch-migrations-with-c-and-nest/))  
However i cant do that on the lastest version of NEST (v5.4).

Using JSON it works perfectly, but not on my code.  
Example of my code:

`var observable1 = client.Reindex<dynamic>(oldIndexName, newIndexName, r => r.MatchAll());`

Can you provide me some example on C#/Java using NESTv5.4?

---

<div class="post-metadata">

**Author:** ![natsudragoneye](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@natsudragoneye](https://discuss.elastic.co/u/natsudragoneye)\
**Post date:** [July 25, 2017, 2:03pm UTC](https://discuss.elastic.co/t/rename-index-name/94303/4 "2017-07-25T14:03:33Z")

</div>

Can you provide me a example using some API (Java/C#)?

---

<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:** [August 22, 2017, 2:03pm UTC](https://discuss.elastic.co/t/rename-index-name/94303/5 "2017-08-22T14:03:49Z")

</div>

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