# We are trying to move Elasticsearch Data from Docker Container to Kubernetes Pod , the default Data path for ES pod is /usr/share/elasticsearch/data/nodes/0/

**URL:** <https://discuss.elastic.co/t/we-are-trying-to-move-elasticsearch-data-from-docker-container-to-kubernetes-pod-the-default-data-path-for-es-pod-is-usr-share-elasticsearch-data-nodes-0/295553>\
**Category:** Elasticsearch\
**Created:** [January 27, 2022, 7:22am UTC](https://discuss.elastic.co/t/we-are-trying-to-move-elasticsearch-data-from-docker-container-to-kubernetes-pod-the-default-data-path-for-es-pod-is-usr-share-elasticsearch-data-nodes-0/295553 "2022-01-27T07:22:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnushaK](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@AnushaK](https://discuss.elastic.co/u/AnushaK)\
**Post date:** [January 27, 2022, 7:22am UTC](https://discuss.elastic.co/t/we-are-trying-to-move-elasticsearch-data-from-docker-container-to-kubernetes-pod-the-default-data-path-for-es-pod-is-usr-share-elasticsearch-data-nodes-0/295553/1 "2022-01-27T07:22:29Z")

</div>

Hi ,

I am trying to copy the indices from the source Elasticsearch to the target Elasticsearch under /usr/share/Elasticsearch/data/nodes/0/indices/. Source and target path is same /usr/share/Elasticsearch/data/nodes/0/indices/ .  
But some how the indices are not loaded in the Kibana Front End.

Not getting any error message as well.  
Can you please help here.

Steps followed :

docker cp es-container-name:/usr/share/Elasticsearch/data /backup-folder  
Copied this backup folder to local machine  
kubectl cp -r data/indices/ podname:/usr/share/Elasticsearch/data/nodes/0/indices/

indices is being copied but unable to view those indices in Kibana Index or index patterns

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [January 27, 2022, 8:01am UTC](https://discuss.elastic.co/t/we-are-trying-to-move-elasticsearch-data-from-docker-container-to-kubernetes-pod-the-default-data-path-for-es-pod-is-usr-share-elasticsearch-data-nodes-0/295553/2 "2022-01-27T08:01:18Z")

</div>

> **Taking a snapshot is the only reliable and supported way to back up a cluster.** You cannot back up an Elasticsearch cluster by making copies of the data directories of its nodes. There are no supported methods to restore any data from a filesystem-level backup. If you try to restore a cluster from such a backup, it may fail with reports of corruption or missing files or other data inconsistencies, or it may appear to have succeeded having silently lost some of your data.

> A copy of the data directories of a cluster’s nodes does not work as a backup because it is not a consistent representation of their contents at a single point in time. You cannot fix this by shutting down nodes while making the copies, nor by taking atomic filesystem-level snapshots, because Elasticsearch has consistency requirements that span the whole cluster. You must use the built-in snapshot functionality for cluster backups.

> **[Snapshot and restore | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshot-restore.html#other-backup-methods)**

According to this document, recommended method to transfer indices is making snapshot on some repository and loading them to other ES cluster as read-only repository and restore the desired index from the snapshot.

Another way is [reindex from a remote cluster](https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade-remote.html).

---

<div class="post-metadata">

**Author:** ![Nisha\_Shaik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nisha_shaik/32/91866_2.png) [@Nisha\_Shaik](https://discuss.elastic.co/u/Nisha_Shaik)\
**Post date:** [January 27, 2022, 9:13am UTC](https://discuss.elastic.co/t/we-are-trying-to-move-elasticsearch-data-from-docker-container-to-kubernetes-pod-the-default-data-path-for-es-pod-is-usr-share-elasticsearch-data-nodes-0/295553/3 "2022-01-27T09:13:31Z")

</div>

Hi @Tomo_M

Thank you for the response .

The Current Scenario is We are taking a backup of ES cluster which has been deployed as Docker Container on a VM . We need to restore it to a pod on Kubernetes cluster which is deployed on cloud environment  
How will snapshot & restore scenario will work ? Is there any way that can help us to backup & restore the data of above mentioned scenario.

Thanks  
Nisha

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 27, 2022, 9:36am UTC](https://discuss.elastic.co/t/we-are-trying-to-move-elasticsearch-data-from-docker-container-to-kubernetes-pod-the-default-data-path-for-es-pod-is-usr-share-elasticsearch-data-nodes-0/295553/4 "2022-01-27T09:36:30Z")

</div>

File system snapshots are not supported (see the link provided earlier), so start up the node on docker and create a proper snapshot on shared storage so that you then can restore it to the new node.

---

<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:** [February 24, 2022, 9:36am UTC](https://discuss.elastic.co/t/we-are-trying-to-move-elasticsearch-data-from-docker-container-to-kubernetes-pod-the-default-data-path-for-es-pod-is-usr-share-elasticsearch-data-nodes-0/295553/5 "2022-02-24T09:36:40Z")

</div>

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