1

For example: from https://localhost:9200 for index 'index_name' to https://localhost:9300 for index 'index2_name'

P. Sithole
  • 151
  • 1
  • 13

2 Answers2

1
----------
This can be easily and seamlessly done using elasticdump:

1. I used git bash (cli) to install elasticdump: npm install elasticdump -g
2. Download logs to a local json file:
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \
  --input=https://localhost:9200/{index_name} \
  --output=index_name.json \
  --type=data

NOTE: NODE_TLS_REJECT_UNAUTHORIZED=0 is for a secured elasticsearch

3. From one elasticsearch server to another 
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \
  --input=https://localhost:9200/{index_name} \
  --output=https://localhost:9300/{index2_name} \
  --type=data

NOTE: NODE_TLS_REJECT_UNAUTHORIZED=0 is for a secured elasticsearch.
      index2_name in the index for the second server (you can use mappings first to create the index before copying over the data, that's if you believe you have 'mapping conflicts' or for best practice)


Here is a refence video on youtube with an example.
https://www.youtube.com/watch?v=Sp7eV0LQzts
P. Sithole
  • 151
  • 1
  • 13
  • @saeed I have used this before and it requires some configuration on elasticsearch.yml... the solution above requires no configuration whatsoever, it's only installation of elasticdump then you done – P. Sithole Jul 23 '21 at 18:38
0

You can also use remote reindex to transfer data from one cluster to another. You can see how to to it here

Saeed Nasehi
  • 940
  • 1
  • 11
  • 27