# Urgent: Major problem in data directory change

**URL:** <https://discuss.elastic.co/t/urgent-major-problem-in-data-directory-change/46355>\
**Category:** Elasticsearch\
**Created:** [April 5, 2016, 8:57am UTC](https://discuss.elastic.co/t/urgent-major-problem-in-data-directory-change/46355 "2016-04-05T08:57:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunilmchaudhari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunilmchaudhari/32/9475_2.png) [@sunilmchaudhari](https://discuss.elastic.co/u/sunilmchaudhari)\
**Post date:** [April 5, 2016, 8:57am UTC](https://discuss.elastic.co/t/urgent-major-problem-in-data-directory-change/46355/1 "2016-04-05T08:57:06Z")

</div>

Hello,  
We have to change the DATA\_DIR path from **current\_dir** to **new\_dir** now in running elasticsearch server in production. because current\_dir has low disk watermark issue.  
I am afraid we wont be able to get old data in Kibana.

Can we move all those indices to the new directory?  
I Not, how can we read the old data at old\_dir from Kibana?  
please reply as soon as possible.

br,  
Sunil

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 5, 2016, 8:01pm UTC](https://discuss.elastic.co/t/urgent-major-problem-in-data-directory-change/46355/2 "2016-04-05T20:01:14Z")

</div>

Your best bet is to stop indexing, flush all the indexes, shut down elasticsearch, do a recursive copy of the data in the first data directory to the new data directory and start elasticsearch again. It should "just work".

---

<div class="post-metadata">

**Author:** ![sunilmchaudhari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sunilmchaudhari/32/9475_2.png) [@sunilmchaudhari](https://discuss.elastic.co/u/sunilmchaudhari)\
**Post date:** [April 6, 2016, 8:45am UTC](https://discuss.elastic.co/t/urgent-major-problem-in-data-directory-change/46355/3 "2016-04-06T08:45:39Z")

</div>

Hi Nik,  
Thanks for the reply.  
If I am correct I have to copy indices directory as it is to new location. Right?

I have checked old data directory. There are couple of files and directories.  
under /var/lib/elasticsearch/prod-elasticsearch/nodes/0/indices/  
above directory has **\_state** directory and node.lock file. What is significance of these 2 when I copy indices?

Somewhere I read about schema. if schema doesnt get copied properly, it will fail? is it true?

br,  
Sunil

---

<div class="post-metadata">

**Author:** ![mikemccand](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mikemccand](https://discuss.elastic.co/u/mikemccand)\
**Post date:** [April 6, 2016, 10:01am UTC](https://discuss.elastic.co/t/urgent-major-problem-in-data-directory-change/46355/4 "2016-04-06T10:01:50Z")

</div>

To be safe, you should copy the entire recursive contents of your data directory over to your new data path...

---

<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, 2017, 11:01pm UTC](https://discuss.elastic.co/t/urgent-major-problem-in-data-directory-change/46355/5 "2017-07-05T23:01:56Z")

</div>


