Backup & Restore indexes ElasticSearch with Elasticdump

Backup & Restore indexes ElasticSearch with Elasticdump

<I>.What is Elasticdump ?

Elasticdump is an import and export tool for elasticsearch to backup and restore Elasticsearch indices into JSON file and store it in the Local disk or in AWS S3 Bucket.

<II>.Use Cases:

Use scenario medium, small volumes of data in scenarios with a medium, small number of indexes or with scenario Elasticsearch running the old version.

<III>.Install elasticsearch-dump

npm install elasticdump -g

<IV>.Backup and Restore

4.1.1 Backup index data to file:

Backup mapping

elasticdump --input=https://"UserName:Password"@<es_host/index_name --output=/es-backup/index_name_mapping.json --type=mapping

Backup data

elasticdump --input=https://"UserName:Password"@<es_host/index_name --output=/es-backup/index_name_data.json --type=data --fileSize=10gb --limit=3000

4.1.2 Restore data from file:

Restore mapping

elasticdump --input=/es-backup/index_name_mapping.json --output=https://"UserName:Password"@<es_host/index_name --type=mapping

Restore data

elasticdump --input=/es-backup/index_name_data.json --output=https://"UserName:Password"@<es_host/index_name --type=data

4.1.2 Backup index data to S3 Bucket:

Backup mapping

elasticdump --s3AccessKeyId "access_key_id" --s3SecretAccessKey "access_key_secret" --input=https://"UserName:Password"@<es_host/index_name --output "s3://bucket_name/index_name_mapping.json"

Backup data

elasticdump --s3AccessKeyId "access_key_id" --s3SecretAccessKey "access_key_secret" --input=https://"UserName:Password"@<es_host/index_name --output=/--output "s3://bucket_name/index_name_data.json --type=data --fileSize=10gb --limit=3000

4.2.2 Restore data from S3 Bucket:

Restore mapping

elasticdump --s3AccessKeyId "access_key_id" --s3SecretAccessKey "access_key_secret" --input="s3://bucket_name/index_name_mapping.json" --output https://"UserName:Password"@<es_host/index_name --type=mapping

Restore data

elasticdump --s3AccessKeyId "access_key_id" --s3SecretAccessKey "access_key_secret" --input="s3://bucket_name/index_name_data.json" --output https://"UserName:Password"@<es_host/index_name --type=data

<V>.To know more about Elasticdump

elasticdump --help