# How to move Data and Logs to new directory?

**URL:** https://discuss.elastic.co/t/how-to-move-data-and-logs-to-new-directory/28382
**Category:** Elasticsearch
**Created:** [August 31, 2015, 7:40pm UTC](https://discuss.elastic.co/t/how-to-move-data-and-logs-to-new-directory/28382 "2015-08-31T19:40:50Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![dkraut](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dkraut](https://discuss.elastic.co/u/dkraut)
#### Post date: [September 1, 2015, 6:33am UTC](https://discuss.elastic.co/t/how-to-move-data-and-logs-to-new-directory/28382/3 "2015-09-01T06:33:31Z")

</div>

Thanks Mark, but I was looking for more detailed steps. Here's what I ended up doing in case anyone else is looking for this information the future. \>

• Determine current location of data files \> curl "localhost:9200/\_nodes/settings?pretty=true"

• Create new directory structure - e.g; \> cd /spare \> mkdir data

• Stop ntopng service \> systemctl stop ntopng.service

• Stop ES service \> systemctl stop elasticsearch.service

• Navigate to the current Data Directory determined in step 1 and copy files to new location \> cp -RP \* /spare/data/

• Change ownership on new directory to elasticsearch \> chown -R elasticsearch:elasticsearch /spare/data

• Edit data path \> vi /etc/elasticsearch/elasticsearch.yml  
\*Edit data parameter “path.data:” to “path.data:/spare/data

• Start ES \> systemctl start elasticsearch.service

• Start ntopng \> ntopng -F "es;flows;ntopng-%Y.%m.%d;[http://127.0.0.1:9200/\_bulk;](http://127.0.0.1:9200/_bulk;)" -e -i 1  
\*careful on this command as your input interface may not be -e -i 1 and your IP may be different.

Worked!!

---

_[View the full topic](https://discuss.elastic.co/t/how-to-move-data-and-logs-to-new-directory/28382)._
