Urgent: Major problem in data directory change

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

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".

1 Like

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

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