# Reindex data without compromising on data loss & search

**URL:** <https://discuss.elastic.co/t/reindex-data-without-compromising-on-data-loss-search/207879>\
**Category:** Elasticsearch\
**Created:** [November 14, 2019, 11:55am UTC](https://discuss.elastic.co/t/reindex-data-without-compromising-on-data-loss-search/207879 "2019-11-14T11:55:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tapan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tapan/32/57669_2.png) [@Tapan](https://discuss.elastic.co/u/Tapan)\
**Post date:** [November 14, 2019, 11:55am UTC](https://discuss.elastic.co/t/reindex-data-without-compromising-on-data-loss-search/207879/1 "2019-11-14T11:55:52Z")

</div>

**Problem statement** : I would like to import data from one index to another index without compromising on data loss and impacting search from web.

Approach taken

I have an index **development\_users\_en\_gb** and would like to import data to **development\_users\_en\_gb\_v1**

1. **development\_users\_en\_gb** index has one development\_users\_en\_gb\_read and development\_users\_en\_gb\_write alias

curl -XGET "[http://localhost:9200/development\_users\_en\_gb/\_alias/\*](http://localhost:9200/development_users_en_gb/_alias/*)"  
{  
"development\_users\_en\_gb" : {  
"aliases" : {  
"development\_users\_en\_gb\_read" : { },  
"development\_users\_en\_gb\_write" : {  
"is\_write\_index" : true  
}  
}  
}  
}

 ![first](https://us1.discourse-cdn.com/elastic/original/3X/4/9/4953c4811fa46a07c40d6887b6a4ad95d320d0f4.png)

1. created new index **development\_users\_en\_gb\_v1**
2. Updated the write alias(development\_users\_en\_gb\_write) to point to new index name **development\_users\_en\_gb\_v1**

POST /\_aliases  
{  
"actions" : [  
{ "remove" : { "index" : "development\_users\_en\_gb", "alias" : "development\_users\_en\_gb\_write" } },  
{ "add" : { "index" : "development\_users\_en\_gb\_v1", "alias" : "development\_users\_en\_gb\_write" } }  
]  
}

curl -XGET "[http://localhost:9200/development\_users\_en\_gb/\_alias](http://localhost:9200/development_users_en_gb/_alias)"  
{  
"development\_users\_en\_gb" : {  
"aliases" : {  
"development\_users\_en\_gb\_read" : { }  
}  
}  
}

curl -XGET "[http://localhost:9200/development\_users\_en\_gb\_v1/\_alias](http://localhost:9200/development_users_en_gb_v1/_alias)"  
{  
"development\_users\_en\_gb\_v1" : {  
"aliases" : {  
"development\_users\_en\_gb\_write" : {  
"is\_write\_index" : true  
}  
}  
}  
}

The development\_users\_en\_gb\_read alias is pointing to development\_users\_en\_gb index(the old index) and development\_users\_en\_gb\_write is pointing towards development\_users\_en\_gb\_v1(the new index)

 ![before](https://us1.discourse-cdn.com/elastic/original/3X/b/2/b214e7c5f53a4891a1573b68ece41650399cdaca.png)  
4. Queried database and indexed all documents through development\_users\_en\_gb\_write alias  
At this point, there is new document created from web but it never reaches development\_users\_en\_gb\_v1(new index). The count of document in development\_users\_en\_gb is different than that of development\_users\_en\_gb\_v1

Question: Why I don't see the data getting pushed to development\_users\_en\_gb\_v1(new index) and not to development\_users\_en\_gb(old index)

Appreciate your help!  
Thanks

---

<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 12, 2019, 11:55am UTC](https://discuss.elastic.co/t/reindex-data-without-compromising-on-data-loss-search/207879/2 "2019-12-12T11:55:53Z")

</div>

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