# Change data path elasticsearch

**URL:** <https://discuss.elastic.co/t/change-data-path-elasticsearch/135648>\
**Category:** Elasticsearch\
**Created:** [June 13, 2018, 7:57am UTC](https://discuss.elastic.co/t/change-data-path-elasticsearch/135648 "2018-06-13T07:57:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreejiths](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sreejiths](https://discuss.elastic.co/u/sreejiths)\
**Post date:** [June 13, 2018, 7:57am UTC](https://discuss.elastic.co/t/change-data-path-elasticsearch/135648/1 "2018-06-13T07:57:55Z")

</div>

I am using Elasticsearch Version 5.6.8 . I am changing the elasticsearch path data in elasticsearch.yml to a new folder in a new mountpoint . When i restart the elasticsearch service its giving below error

[2018-06-13T15:49:36,873][ERROR][o.e.b.Bootstrap] Exception  
java.lang.IllegalStateException: detected index data in default.path.data [/var/lib/elasticsearch] where there should not be any; check the logs for details

I have already done chown elasticsearch:elasticsearch for the new folder ..Why is elasticsearch complaining of index data in default.path.data

Please help

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [June 18, 2018, 1:55am UTC](https://discuss.elastic.co/t/change-data-path-elasticsearch/135648/2 "2018-06-18T01:55:54Z")

</div>

> [@sreejiths](#):
>
> [2018-06-13T15:49:36,873][ERROR][o.e.b.Bootstrap] Exception  
> java.lang.IllegalStateException: detected index data in default.path.data [/var/lib/elasticsearch] where there should not be any; check the logs for details

Is this the old data path, or the new one?  
I assume it's the old one.

This error is telling you that you have configured your ES node to use a custom data path, but you also have index data in the default data path (`/var/lib/elasticsearch`).  
This is almost always a mistake, and if ES starts writing to the new data path, then you will get yourself into a state with diverging indices that probably cannot be recovered correctly.

When you create a new (replacement) data path, you need to manually _move_ the data from the old path to the new path. Feel free to keep a copy of the old data somewhere, but don't keep it in the old data path.

---

<div class="post-metadata">

**Author:** ![sreejiths](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sreejiths](https://discuss.elastic.co/u/sreejiths)\
**Post date:** [June 18, 2018, 4:27am UTC](https://discuss.elastic.co/t/change-data-path-elasticsearch/135648/3 "2018-06-18T04:27:29Z")

</div>

I came about this but for elasticsearch ..looks like same behaviour ..But my elasticsearch is 5.6.8 ..The blog says its fixed from 5.3 versions ☹

> **[Multi data path bug in Elasticsearch 5.3.0](https://www.elastic.co/blog/multi-data-path-bug-in-elasticsearch-5-3-0)**
>
> If you use a custom data path with Elasticsearch 5.3.0, you may be subject to a bug which could cause data loss unless properly handled.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [June 18, 2018, 5:25am UTC](https://discuss.elastic.co/t/change-data-path-elasticsearch/135648/4 "2018-06-18T05:25:52Z")

</div>

Please read my reply above.

The behaviour you are seeing is intentional. It is not a bug, it is attempting to prevent your data from being corrupted due to bugs or misconfiguration.

You can read that message as if it were saying:

> You have changed the `path.data` from its default value to another value, but there is still data in the default location. This could be a misconfiguration, or it could be the result of a bug. Please investigate and make sure that your index data in in the correct place before you restart your node.

---

<div class="post-metadata">

**Author:** ![sreejiths](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sreejiths](https://discuss.elastic.co/u/sreejiths)\
**Post date:** [June 18, 2018, 7:04am UTC](https://discuss.elastic.co/t/change-data-path-elasticsearch/135648/5 "2018-06-18T07:04:50Z")

</div>

Ok ..Got it ..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:** [July 16, 2018, 7:04am UTC](https://discuss.elastic.co/t/change-data-path-elasticsearch/135648/6 "2018-07-16T07:04:59Z")

</div>

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