# Changing the path of the data and logs directories

**URL:** <https://discuss.elastic.co/t/changing-the-path-of-the-data-and-logs-directories/131284>\
**Category:** Elasticsearch\
**Created:** [May 10, 2018, 10:26am UTC](https://discuss.elastic.co/t/changing-the-path-of-the-data-and-logs-directories/131284 "2018-05-10T10:26:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuwan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nuwan/32/42325_2.png) [@nuwan](https://discuss.elastic.co/u/nuwan)\
**Post date:** [May 10, 2018, 10:26am UTC](https://discuss.elastic.co/t/changing-the-path-of-the-data-and-logs-directories/131284/1 "2018-05-10T10:26:12Z")

</div>

I installed ElasticSearch using defaults. . I'd like to change path of the data and logs directories to other location than default location

Create new directory structure - e.g; \> makdir /data/elkdata && makdir /data/elklogs  
Navigate to the current Data Directory determined in step 1 and copy files to new location \> cp -RP \* /data/elakdata  
Change ownership on new directory to elasticsearch \> chown -R elasticsearch:elasticsearch /data/elkdata  
Edit data path \> vi /etc/elasticsearch/elasticsearch.yml  
\*Edit data parameter “path.data:” to “path.data:/data/elakdata

[root@915454-elastic3 data]# ll  
total 36  
drwxr-xr-x. 3 elasticsearch elasticsearch 4096 May 10 05:55 elkdata  
drwxr-xr-x. 3 elasticsearch elasticsearch 4096 May 10 05:27 elklogs  
drwx------. 2 root root 16384 Mar 4 15:23 lost+found  
drwxr-xr-x. 8 mysql mysql 4096 May 9 01:21 mysql  
drwxr-x---. 2 mysql mysql 4096 Jan 3 14:34 mysqllogs  
drwxr-x--T. 2 mysql mysql 4096 May 9 01:21 mysqltmp

after that elastic search faild to start

---

<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:** [June 7, 2018, 10:26am UTC](https://discuss.elastic.co/t/changing-the-path-of-the-data-and-logs-directories/131284/2 "2018-06-07T10:26:13Z")

</div>

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