# Moving the elastic directory

**URL:** <https://discuss.elastic.co/t/moving-the-elastic-directory/33165>\
**Category:** Elasticsearch\
**Created:** [October 28, 2015, 4:22pm UTC](https://discuss.elastic.co/t/moving-the-elastic-directory/33165 "2015-10-28T16:22:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ant/32/33267_2.png) [@Ant](https://discuss.elastic.co/u/Ant)\
**Post date:** [October 28, 2015, 4:22pm UTC](https://discuss.elastic.co/t/moving-the-elastic-directory/33165/1 "2015-10-28T16:22:07Z")

</div>

Hi,

So as can be the problem when you wander blindly in the dark I've set up an elastic box as a VM and given it 2TB of disk however not realising that the /root directory on Linux was its own partition that's where I've set things up and so I'm not starting to find I'm running out of disk at that partition was only 50GB

The data that is in there represents a significant volume of effort and I don't want to have to recreate it. So I wanted to see if either of these 2 solutions would work.

1. stop all processed feeding elastic  
shut down elastic  
move the folder from root to opt  
start back up  
restart feeder processes

2. As I'm thinking of putting it on it's own physical hardware anyway  
Set up a new box  
put everything in the right place this time  
give it the same cluster name  
wait for it to replicate  
decommission the old box.

or if they won't does anyone know what will?

May thanks  
Ant

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [October 28, 2015, 5:15pm UTC](https://discuss.elastic.co/t/moving-the-elastic-directory/33165/2 "2015-10-28T17:15:06Z")

</div>

Hello,  
the first procedure, that requires downtime sounds ok. don't forget to make elasticsearch point to the new data location through path.data in elasticsearch.yaml.

The second one, that relies on replication, will work if you have one node only, you start a new one, and set number\_of\_replicas to 1 and then wait for replication to be completed. At that point you should have fully replicated indices, which means that you can afford to take one of the two nodes down without losing data. Otherwise you could also play with shard allocation settings and manage to reroute all shards to the new node before bringing the old one down, which you would do only when empty.

Cheers  
Luca

---

<div class="post-metadata">

**Author:** ![Ant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ant/32/33267_2.png) [@Ant](https://discuss.elastic.co/u/Ant)\
**Post date:** [October 28, 2015, 5:38pm UTC](https://discuss.elastic.co/t/moving-the-elastic-directory/33165/3 "2015-10-28T17:38:47Z")

</div>

Thank you Luca,

I only have the one node at the moment so that should all be good, if I can't source the box before it runs out I may do option 1 to buy myself a bit more time.

I think the paths are not set so going to defaults so would I be right in thinking that so long as I move the whole folder it would look for them based on them being in the same place respective of the elastic binary?

Many Thanks  
Ant

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [October 28, 2015, 5:56pm UTC](https://discuss.elastic.co/t/moving-the-elastic-directory/33165/4 "2015-10-28T17:56:30Z")

</div>

Not sure I got it, but you mean that you would fix the partitions and the path of the directory would still be the same? In that case it would continue to work. If the path differs from the previous one you do have to go update the path.data.

Cheers  
Luca

---

<div class="post-metadata">

**Author:** ![Ant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ant/32/33267_2.png) [@Ant](https://discuss.elastic.co/u/Ant)\
**Post date:** [October 28, 2015, 8:14pm UTC](https://discuss.elastic.co/t/moving-the-elastic-directory/33165/5 "2015-10-28T20:14:28Z")

</div>

Luca,

I think that makes sense, thank you for the clarification.

Kind Regards  
Ant

---

<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:42pm UTC](https://discuss.elastic.co/t/moving-the-elastic-directory/33165/6 "2017-07-05T23:42:02Z")

</div>


