How to copy ES (v 5.x) index from one server to another server. i don't have privileges to install any software in that machine. have any better solution to copy the index ? will backup and restore work? please share your suggestion
Asked
Active
Viewed 1.2k times
2 Answers
14
You can reindex from remote server
POST _reindex
{
"source": {
"remote": {
"host": "http://otherhost:9200",
"username": "user",
"password": "pass"
},
"index": "source",
"query": {
"match": {
"test": "data"
}
}
},
"dest": {
"index": "dest"
}
}
You can also use snapshots but it will require you to change config files and have storage accessible by both servers

pkhlop
- 1,824
- 3
- 18
- 23
-
thanks for ur reply. since i am new to ES . say copy host-1 - emp index to host-2 emp index. how can i use reindex on this.? also provide some information on what is reindex? – Learn Hadoop Mar 08 '18 at 18:47
-
@LearnHadoop You do the reindex on host-2, then you set the remote to the source host-1 – Ashraf Sarhan May 18 '20 at 23:21
5
Reindex will copy your documents from the source index to the destination index. But before you do that your destination index needs to be created and configured first. Reindexing won't copy your settings and mappings from the old index to the new index. To get everything, you need to create a snapshot of the source index and then restore it in the destination index. Here is the elasticsearch documentation for snapshot and restore. This link is also pretty helpful.

WaughWaugh
- 1,012
- 10
- 15