elasticsearch javascript node.js taskrabbit
2016-04-22T23:01:16.761Z - Originally posted at https://tech.taskrabbit.com/blog/2014/01/06/elasticsearch-dump/
↞ See all posts
At TaskRabbit, we use ElasticSearch for a number of things (which include search of course). In our development, we follow the normal pattern of having a few distinct environments which we use to build and test our code. The ‘acceptance’ environment is supposed to be a mirror of production, including having a copy of its data. However, we could not find a good tool to help us copy our Elastic Search indices… so we made one!
elasticdump works by sending an input to an output. Both can be either an elasticsearch URL or a File.
{proticol}://{host}:{port}/{index}
http://127.0.0.1:9200/my_index
{FilePath}
/Users/evantahler/Desktop/dump.json
You can then do things like:
Copy an index from production to staging:
1elasticdump --input=http://production.es.com:9200/my_index --output=http://staging.es.com:9200/my_index
Backup an index to a file:
1elasticdump --input=http://production.es.com:9200/my_index --output=/var/dat/es.json
Inspired by https://github.com/crate/elasticsearch-inout-plugin and https://github.com/jprante/elasticsearch-knapsack
You can download elasticdump from NPM or GitHub
Originally published at 06 Jan 2014
I write about Technology, Software, and Startups. I use my Product Management, Software Engineering, and Leadership skills to build teams that create world-class digital products.
Get in touch