So you want to migrate Elasticsearch indices from one installation to another. The solution presented here will need Node.js and the package elasticdump
from NPM. You will need to set up these on a system from which you want to do the migrations. Let's start.
First make sure Node.js is installed.
Then install elasticdump by running the command.
npm i elasticdump -g
Note: This
-g
will installelasticdump
globally. If you got a permission error run withsudo
Now we can use this package to move an index from one es to another.
elasticdump \
--input=http://i1.es.in:9200/index_1 \
--output=http://i2.es.in:9200/index_1 \
--type=mapping
--input=
arg is the es source instance where you want to move the index from
--output=
is the destinaation es
--type=
has three options
-
mapping
if you only want to move index mapping -
data
if you want to migrate data -
analyzer
includes analyzer and mapping
Do this query to list all indices on an elastic instance
GET _cat/indices?v
Top comments (2)
Does this work in migration from Elastic to OpenSearch?
Yes. I have done that before.