Reindexing from a remote cluster
The snapshot and restore APIs are very fast and are the preferred way to back up data. However, they do have some limitations:
- The backup is a safe Lucene index copy, so it depends on the Elasticsearch version that has been used. If you are switching from a version of Elasticsearch that is earlier than version 5.x, then it's not possible to restore the old indices.
- It's not possible to restore the backups of a newer Elasticsearch version in an older version; the restore is only forward compatible.
- It's not possible to restore partial data from a backup.
To be able to copy data in this scenario, the solution is to use the reindex API using a remote server.
Getting ready
You will need an up-and-running Elasticsearch installation – similar to the one that we described in the Downloading and installing Elasticsearch recipe of Chapter 1, Getting Started.
In order to execute the commands, any HTTP client...