How to make dump of Elasticsearch index
Task: Create dump of index in JSON format
Steps:
install npm
install elasticdump tools:
npm install elastic dump -g
command to make a dump of index by name:
elasticdump --input=http://<elasticsearch>/<index> --output=<file.json> --type=data
As a result you will have a file json.
Addition examples:
If you want to import data from file to index use:
elasticdump --input=<file.json> --output=http://<elasticsearch>/<index> --type=data
If you want to import data from one server to another use:
elasticdump --input=http://<elasticsearchinput>/<index> --output=http://<elasticsearchoutput>/<index> --type=data
Useful params:
--limit=10000 Set package limit (default 100)
--fsCompress gzip data before sending outputting to file