---
title: "Online index migration and shard scaling in OpenSearch with the AOSC plugin"
url: https://daily.dev/posts/online-index-migration-and-shard-scaling-in-opensearch-with-the-aosc-plugin-71htrmixu
source_url: https://opensearch.org/blog/online-index-migration-and-shard-scaling-in-opensearch-with-the-aosc-plugin
type: article
source: "OpenSearch"
published: 2026-08-23T12:22:27.158Z
updated: 2026-08-23T12:54:00.209Z
tags: ["open-source", "backend", "opensearch"]
reading_time: 11
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Online index migration and shard scaling in OpenSearch with the AOSC plugin

**[OpenSearch](https://daily.dev/sources/opensearch)** · 11 min read · 0 upvotes · 0 comments

## Summary

Atlassian Labs has released AOSC (Automatic Online Schema Change), an open-source OpenSearch plugin that migrates a live index to a new target with different mappings, settings, or shard count without downtime. It backfills existing documents, replays writes and deletes that arrive during the copy, and swaps an alias after a brief write-block cutover window, requiring only simple retry logic from applications. Shard-count changes are safe for same-count or power-of-two growth, since OpenSearch's operation history does not track routing keys for deletes, making shrinking or non-power-of-two growth unsafe with custom routing. The plugin is Apache 2.0 licensed and available on GitHub, with same-cluster scope only and a required alias for cutover to work.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://opensearch.org/blog/online-index-migration-and-shard-scaling-in-opensearch-with-the-aosc-plugin>

## Questions this post answers

### How can I change the number of primary shards in an OpenSearch index without downtime?

The open-source AOSC plugin migrates a live OpenSearch index to a pre-created target index with a different shard count while the source keeps serving writes. It backfills existing documents, replays writes that arrive during the copy, then applies a brief write block to the source before swapping an alias to the target, so applications only need retry logic.

_Track new tools like AOSC for zero-downtime schema changes by following OpenSearch releases on daily.dev._

### Why can changing shard count in OpenSearch cause deleted documents to reappear or persist?

OpenSearch's operation history records a deleted document's _id but not its routing key, so when a migration target has a different shard count, a replayed delete can miss the document it was meant to remove. This is tracked as OpenSearch issue 20907. The AOSC plugin works around it by only allowing same shard count or power-of-two growth, where the shard split is deterministic and a routing-less delete can be fanned out across a fixed block of target shards; shrinking or non-power-of-two growth with custom routing is blocked unless explicitly forced.

_Engineers planning OpenSearch shard changes can follow routing edge cases like this via daily.dev._

### What are the limitations of using OpenSearch's _reindex API to migrate a live index?

The _reindex API only copies a point-in-time snapshot of the source index and does not track or replay writes that land after it starts, so on a busy index the reconciliation of concurrent writes becomes a separate problem the developer must solve. It is a reasonable option only when the source index can be made quiet or there is already a separate mechanism to reconcile in-flight writes.

_Compare live-migration tradeoffs like this for OpenSearch and other databases on daily.dev._

## Similar posts on daily.dev

- [Online index migration and shard-scaling in OpenSearch with AOSC](https://daily.dev/posts/online-index-migration-and-shard-scaling-in-opensearch-with-aosc-oz3ahpybh) · Atlassian · 0 upvotes · 0 comments
- [Guide to Migrating from Apache Solr to OpenSearch](https://daily.dev/posts/guide-to-migrating-from-apache-solr-to-opensearch-5b3pqrwmf) · BigData Boutique blog · 4 upvotes · 0 comments

---

Tags: [#open-source](https://daily.dev/tags/open-source), [#backend](https://daily.dev/tags/backend), [#opensearch](https://daily.dev/tags/opensearch)

[View this post on daily.dev](https://daily.dev/posts/online-index-migration-and-shard-scaling-in-opensearch-with-the-aosc-plugin-71htrmixu)
