elasticsearch-dump /elasticsearch-dump
Import and export tools for elasticsearch & opensearch
★ 7,944⑂ 858👁 141▤ 197
7,944
stars
+0+-1
858
forks
141
watchers
–
prs
–
issues
197
releases
–
discussions
README
elasticdump
==================
Tools for moving and saving indices from Elasticsearch and OpenSearch
!picture
---
Version Warnings!
- Version 1.0.0 of Elasticdump changes the format of the files created by the dump. Files created with version 0.x.x of this tool are likely not to work with versions going forward. To learn more about the breaking changes, vist the release notes for version 1.0.0. If you recive an "out of memory" error, this is probably or most likely the cause.
- Version 2.0.0 of Elasticdump removes the bulk options. These options were buggy, and differ between versions of Elasticsearch. If you need to export multiple indexes, look for the multielasticdump section of the tool.
- Version 2.1.0 of Elasticdump moves from using scan/scroll (ES 1.x) to just scroll (ES 2.x). This is a backwards-compatible change within Elasticsearch, but performance may suffer on Elasticsearch versions prior to 2.x.
- Version 3.0.0 of Elasticdump has the default queries updated to only work for ElasticSearch version 5+. The tool may be compatible with earlier versions of Elasticsearch, but our version detection method may not work for all ES cluster topologies
- Version 5.0.0 of Elasticdump contains a breaking change for the s3 transport. _s3Bucket_ and _s3RecordKey_ params are no longer supported please use s3urls instead
- Version 6.1.0 and higher of Elasticdump contains a change to the upload/dump process. This change allows for overlapping promise processing. The benefit of which is improved performance due increased parallel processing, but a side-effect exists where-by records (data-set) aren't processed in a sequential order (the ordering is no longer guaranteed)
- Version 6.67.0 and higher of Elasticdump will quit if the node.js version does not match the minimum requirement needed (v10.0.0)
- Version 6.76.0 and higher of Elasticdump added support for OpenSearch (forked from Elasticsearch 7.10.2)
Installing
(local)
bash
npm install elasticdump
./bin/elasticdump
(global)
bash
npm install elasticdump -g
elasticdump
Use
Standard Install
Elasticdump works by sending an input to an output. Both can be either an elasticsearch URL or a File.
Elasticsearch/OpenSearch:
- format: {protocol}://{host}:{port}/{index}
- example: http://127.0.0.1:9200/my_index
File:
- format: {FilePath}
- example: /Users/evantahler/Desktop/dump.json
Stdio:
- format: stdin / stdout
- format: $
You can then do things like:
bash
Copy an index from production to staging with analyzer and mapping:
elasticdump \
--input=http://production.es.com:9200/my_index \
--output=http://staging.es.com:9200/my_index \
--type=analyzer
elasticdump \
--input=http://production.es.com:9200/my_index \
--output=http://staging.es.com:9200/my_index \
--type=mapping
elasticdump \
--input=http://production.es.com:9200/my_index \
--output=http://staging.es.com:9200/my_index \
--type=data
Backup index data to a file:
elasticdump \
--input=http://p