Install ElasticDump
npm install elasticdump -g
Data output
mkdir -p /home/pppc/esData
elasticdump --input=http://192.168.100.198:9200/mshpshop --output=/home/pppc/esData/mshpshop.log
elasticdump --input=http://192.168.100.198:9200/mprdproduct --output=/home/pppc/esData/mprdproduct.log
elasticdump --input=http://192.168.100.198:9200/mspcspecial --output=/home/pppc/esData/mspcspecial.log
elasticdump --input=http://192.168.100.198:9200/searchwordinfo --output=/home/pppc/esData/searchwordinfo.log
delete data
curl -XDELETE http://127.0.0.1:9200/mshpshop/
curl -XDELETE http://127.0.0.1:9200/mprdproduct/
curl -XDELETE http://127.0.0.1:9200/mspcspecial/
curl -XDELETE http://127.0.0.1:9200/searchwordinfo/
data import
elasticdump --output=http://127.0.0.1:9200/mshpshop --input=/home/pppc/esData/mshpshop.log
elasticdump --output=http://localhost:9200/mprdproduct --input=/home/pppc/esData/mprdproduct.log
elasticdump --output=http://localhost:9200/mspcspecial --input=/home/pppc/esData/mspcspecial.log
elasticdump --output=http://localhost:9200/searchwordinfo --input=/home/pppc/esData/searchwordinfo.log
# Use elasticdump tool to realize data backup and transfer in reindex mode:
# index->index:
# elasticdump --input=http://localhost:9200/test --output=http://localhost:9200/test
# index->file:
# elasticdump --input=http://localhost:9200/test --output=./json.log
# file->index:
# elasticdump --input=./json.log --output=http://localhost:9200/test