Reindexing copies documents from one Elasticsearch index into another. Use it when an existing index needs settings or mapping changes that cannot be safely applied in place, or when primary-shard capacity was planned incorrectly. section 3.5 section 4.3.3
The safe pattern is to create a destination index with the required mapping and settings, copy documents into it, verify it works, switch the application, and then remove the old index. An alias can make the switch seamless and support zero-downtime migration. section 4.3.3 section 5.7
Copy movies into an updated index
Send a POST request to `_reindex`. `source.index` names the existing `movies` index; `dest.index` names `movies_new`, which should be prepared with the updated schema or settings. The operation takes a snapshot of the source and writes its records to the destination. section 5.7
Listing 5.50 Migrating data between indexes using the _reindex API
POST _reindex
{
"source": {"index": "movies"},
"dest": {"index": "movies_new"}
}
Use this request shape to migrate documents from `movies` to `movies_new`. Replace both names with the source and prepared destination indexes for your migration. section 5.7
Keep these operational limits in mind:
- Primary-shard counts cannot be changed on an operating index because routing depends on that count; create a new index and reindex instead. section 3.5
- Changing a field type on a live index is prohibited because existing indexed data follows the original schema; migrate into an index with corrected declarations. section 4.3.3
- Reindexing can support production migration without downtime when paired with aliases, but consider its performance implications. section 5.0 section 5.7

