Elasticsearch

Backing up elasticsearch database into a file

There is an opensource npm library that help to export and import elasticsearch index. Here is their tool elasticsearch-dump page where you can find more information how to do that.

1
2
3
4
5
6
7
8
9
# Backup index data to a file:
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=/data/my_index_mapping.json \
  --type=mapping
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=/data/my_index.json \
  --type=data