How to download ElasticSearch snapshot from repository to local machine?

Viewed 2313

I'm using a small elasticsearch cluster from the elastic cloud.
I need to:

  1. download one of the indices from elasticsearch to my local machine for analysis
  2. set up elasticsearch node locally and restore this index into it.

In Kibana UI in section Snapshot and Restore I can see my snapshots and this hint:

Use repositories to store and recover backups of your Elasticsearch indices and clusters.

But how do I download the actual data from elasticsearch index to my machine (as a bunch of jsons) and import it into elasticsearch running locally?

1 Answers

With a small cluster, and with just a few indices, I'd use the reindex api and just let your local instance index the data directly from your remote.

POST _reindex
{
  "source": {
    "remote": {
      "host": "https://...cloud.es.io:9243",
      "username": "user",
      "password": "pass"
    },
    "index": "source"
  },
  "dest": {
    "index": "dest"
  }
}

Have a look here for the official documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade-remote.html

Related