I am looking for the tools to migrate data from 1.x to 2.x elasticsearch. Please suggest if anything is available?
Asked
Active
Viewed 414 times
1 Answers
1
You have a few options. You can use Logstash in order to copy indices from your old 1.x ES to your new 2.x ES:
input {
elasticsearch {
hosts => ["old-es:9200"] <--- source ES host
index => "source_index" <--- source index to copy
docinfo => true
}
}
filter {
mutate {
remove_field => [ "@version", "@timestamp" ] <--- remove added junk
}
}
output {
elasticsearch {
hosts => ["new-es:9200]" <--- target ES host
index => "%{[@metadata][_index]}"
document_type => "%{[@metadata][_type]}"
document_id => "%{[@metadata][_id]}"
}
}
You can also use elasticdump and use the following commands to copy source_index
from old-es:9200
to your new-es:9200
host:
elasticdump \
--input=http://old-es:9200/source_index \
--output=http://new-es:9200/source_index \
--type=analyzer
elasticdump \
--input=http://old-es:9200/source_index \
--output=http://new-es:9200/source_index \
--type=mapping
elasticdump \
--input=http://old-es:9200/source_index \
--output=http://new-es:9200/source_index \
--type=data

Val
- 207,596
- 13
- 358
- 360
-
Thanks a lot @val .. you are amazing.. :) I did used elasticdump as my both the servers are in different network and there is no route, so i cannot use logstash. With elasticdumnp i took the dump in file and then transferred the file to the new instance and put the dump in the new server. It worked perfect.. Thanks again – user1819071 Jul 25 '16 at 04:57