# Can we control file/location where index data is stored in Elasticsearch?

**URL:** <https://discuss.elastic.co/t/can-we-control-file-location-where-index-data-is-stored-in-elasticsearch/322587>\
**Category:** Elasticsearch\
**Created:** [January 6, 2023, 4:55am UTC](https://discuss.elastic.co/t/can-we-control-file-location-where-index-data-is-stored-in-elasticsearch/322587 "2023-01-06T04:55:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sundar.s](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sundar.s](https://discuss.elastic.co/u/sundar.s)\
**Post date:** [January 6, 2023, 4:55am UTC](https://discuss.elastic.co/t/can-we-control-file-location-where-index-data-is-stored-in-elasticsearch/322587/1 "2023-01-06T04:55:16Z")

</div>

Hi,

Can we control the file or location where the index data of particular index is stored in Elasticsearch?

That is, let say, I have multiple indices in my Elasticsearch indices and one of which is called `index1`

Can I specify the location/file where the data specific to the `index1` to be stored on creation?  
Can I back up the files specific to `index1` alone separately ?  
Can I restore the index `index1` from the back up?

Any response on this would be greatly appreciated.

Thanks.  
Sundar.

---

<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:** [January 6, 2023, 6:05am UTC](https://discuss.elastic.co/t/can-we-control-file-location-where-index-data-is-stored-in-elasticsearch/322587/2 "2023-01-06T06:05:09Z")

</div>

You can not specify location for an index within a node. You can however backup specific indices using the snapshot API. Note that file system level backups or snapshots are not supported.

---

<div class="post-metadata">

**Author:** ![sundar.s](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sundar.s](https://discuss.elastic.co/u/sundar.s)\
**Post date:** [January 6, 2023, 6:29am UTC](https://discuss.elastic.co/t/can-we-control-file-location-where-index-data-is-stored-in-elasticsearch/322587/3 "2023-01-06T06:29:59Z")

</div>

Thanks @Christian_Dahlqvist for the response

---

<div class="post-metadata">

**Author:** ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)\
**Post date:** [January 6, 2023, 2:07pm UTC](https://discuss.elastic.co/t/can-we-control-file-location-where-index-data-is-stored-in-elasticsearch/322587/4 "2023-01-06T14:07:00Z")

</div>

@sundar.s depending on the stack version, you can use node attributes to define where a particular index should be stored. For a more generic configuration, this setting can be specified in index template itself.  
The whole idea of Hot-Warm-Cold architecture is based on this where most recent indices are stored on Hot nodes (which have node.attr set to hot), older ones on Warm and very old (basically not being used anymore even for searching/ analysis hence frozen indices) on Cold.

However, you need to analyze the number of shards for each index as you should have count of nodes per attr = max. number of shards (pri+rep) of any index to be stored on attr labelled nodes.

---

<div class="post-metadata">

**Author:** ![sundar.s](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sundar.s](https://discuss.elastic.co/u/sundar.s)\
**Post date:** [January 17, 2023, 11:04am UTC](https://discuss.elastic.co/t/can-we-control-file-location-where-index-data-is-stored-in-elasticsearch/322587/5 "2023-01-17T11:04:49Z")

</div>

Thanks Ayush

---

<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:** [February 14, 2023, 11:05am UTC](https://discuss.elastic.co/t/can-we-control-file-location-where-index-data-is-stored-in-elasticsearch/322587/6 "2023-02-14T11:05:14Z")

</div>

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