# Is it possible to recover the data if we delete the segment file for the index?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-recover-the-data-if-we-delete-the-segment-file-for-the-index/274941>\
**Category:** Elasticsearch\
**Created:** [June 4, 2021, 4:13am UTC](https://discuss.elastic.co/t/is-it-possible-to-recover-the-data-if-we-delete-the-segment-file-for-the-index/274941 "2021-06-04T04:13:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josephyan](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@Josephyan](https://discuss.elastic.co/u/Josephyan)\
**Post date:** [June 4, 2021, 4:13am UTC](https://discuss.elastic.co/t/is-it-possible-to-recover-the-data-if-we-delete-the-segment-file-for-the-index/274941/1 "2021-06-04T04:13:26Z")

</div>

Hi Everyone,

If the segment files were deleted for the index, is it possible to recover the index's data?

Thanks a lot for your great help!

Elasticsearch version: 2.1

Regards,  
Joe

---

<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:** [June 4, 2021, 5:03am UTC](https://discuss.elastic.co/t/is-it-possible-to-recover-the-data-if-we-delete-the-segment-file-for-the-index/274941/2 "2021-06-04T05:03:19Z")

</div>

That is where the data is stored so unless you have another working replica shard or a snapshot the I believe the answer is no.

---

<div class="post-metadata">

**Author:** ![Josephyan](https://avatars.discourse-cdn.com/v4/letter/j/e56c9b/32.png) [@Josephyan](https://discuss.elastic.co/u/Josephyan)\
**Post date:** [June 4, 2021, 3:05pm UTC](https://discuss.elastic.co/t/is-it-possible-to-recover-the-data-if-we-delete-the-segment-file-for-the-index/274941/3 "2021-06-04T15:05:28Z")

</div>

Hi Christian,

Thanks a lot for your answers.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 7, 2021, 4:29am UTC](https://discuss.elastic.co/t/is-it-possible-to-recover-the-data-if-we-delete-the-segment-file-for-the-index/274941/4 "2021-06-07T04:29:13Z")

</div>

Why would you delete the segment file to start with?

---

<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, 2021, 4:30am UTC](https://discuss.elastic.co/t/is-it-possible-to-recover-the-data-if-we-delete-the-segment-file-for-the-index/274941/5 "2021-07-05T04:30:00Z")

</div>

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