Elastic Search Version 6.2 is used for this example
Elasticdump
take index mappings dump to json
/usr/bin/elasticdump \
--type=mapping \
--input=http://localhost:9200/index_mame \
--output "/file/to/write/index_name.mapping.json"
take index data dump to json
/usr/bin/elasticdump \
--type=data \
--concurrency=100 \
--intervalCap=500 \
--input=http://localhost:9200/index_mame \
--output "/file/to/write/index_name.data.json"
create index with mappings
/usr/bin/elasticdump \
--type=mapping \
--input "/path/to/maping-file.mapping.json" \
--output=http://localhost:9200/index_name
restore data from other index
/usr/bin/elasticdump \
--type=data \
--concurrency=100 \
--intervalCap=500 \
--input "/file/to/data-dump.data.json" \
--output=http://localhost:9200/index_name
_source only backup
/usr/bin/elasticdump \
--type=data \
--concurrency=100 \
--intervalCap=500 \
--sourceOnly=true \
--input=http://localhost:9200/index_name \
--output "/file/to/data-dump.data.json"
_bulk API
curl -XPOST localhost:9200/index_name/Document_Type/_bulk -H 'Content-Type: application/json' --data-binary @/path/to/file