Search code examples
dockerelasticsearchcontainersetl

How to transform/migrate indices from self hosted Elasticsearch to a ES docker container?


I have a self hosted elasticsearch and I wanted to transform all indices to a elasticsearch docker container.

What are the possible solutions to move all indices from localhost ES cluster to the ES container?


Solution

  • After digging in the internet, I found the answer of my question. It has a simple solution. Just Copy -> Paste. The procedure is as follows:

    1. Find the location of indices in the self hosted Elasticsearch. Go to the elasticsearch directory /usr/share/elasticsearch/ ( or any other installation directory). In the conf/elasticsearch.yml file, find the path.data. (The default is /var/lib/elasticsearch/)
    2. Copy the content of /var/lib/elasticsearch/nodes/<node id>/indices/
    3. Paste those to your docker container volume. <your-volume-path>/nodes/<node id>/indices/