Hi,
I have written a very simple and easy-to-use importing/exporting tool for
Elasticsearch, the Knapsack plugin.
How does it work?
Knapsack depends on the _source field being enabled. By executing an
_export command via curl HTTP POST, the export starts and performs a
background threaded loop of scan/scroll request/response over the index.
Each document _source is written as a tar entry to a tar archive file in
the local file system. By default, the tar archive is gzipped.
Also, the index setting and mapping is written into the tar.
The tar entry name consists of index/type/id, and the name of the tar
archive consists of '_' '.tar.gz'
Importing works exactly the other way round. Put a tar archive into the
file system, and import it via _import with curl HTTP POST. A background
thread is spawned and the tar archive is bulk-inserted into Elasticsearch.
By file renaming, you can even copy indices.
Note, it is not a full-fledged backup/restore solution, it is just a toy,
with many features not (yet) present. It can help in situations where you
want to offload indices quickly and transfer it to another place, e.g. for
bug hunting, or for testing.
So, if your indices want to take a hike, maybe across Elasticsearch
clusters, put the knapsack on and enjoy!
Cheers,
Jörg
--