Reputation: 3060
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
Upvotes: 7
Views: 14623
Reputation: 1032
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.
Upvotes: 6
Reputation: 1844
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
Upvotes: 14