migrate_index_ownership(
index_name: strUpgrade a legacy index and backfill its hashed ownership marker.
Preview by default; pass dry_run=False to apply. The index must have a
dedicated document namespace: all indexed documents must belong to it.
Missing, null and raw index-name markers are backfilled; already-hashed
markers are left alone. Conflicting markers are refused before mutation.
JSON documents must have object roots.
Use a client configured with protocol=2. Explicit protocol=3 clients
are rejected before any Redis operations.
Only persistent indexes are supported. Do not use this utility on indexes created with FT.CREATE TEMPORARY: dropping them during a rebuild deletes their documents even without DD. FT.INFO does not expose this option, so the utility cannot detect and reject these indexes automatically.
Stop all application/background writers and back up the schema before applying.
After applying, restart the writers or recreate every RedisVectorStore instance
so no process continues writing markers using its cached legacy schema.
Missing fields use FT.ALTER; legacy TEXT or incompatible TAG fields require
recreating the index definition, causing query downtime during reindexing.
For supported persistent indexes, document keys, embeddings and TTLs are
retained. Supply every desired alias in aliases so it can be restored
after a rebuild or interrupted run.
Rebuilds require this argument explicitly; use an empty iterable when the
index has no aliases.
Custom FT.CREATE options and nonstandard ownership paths require manual
migration. Indexes with overlapping prefixes of the same storage type cannot
be migrated automatically; recreate them with disjoint prefixes instead.
For both previews and applied migrations, credentials must permit FT._LIST
and FT.INFO on every index, including those outside the target key prefix,
so overlap checks can inspect all index definitions.
Every migration, including previews and reruns, requires exactly one of the
complete deployment source_schema or the original source_config used
for a generated schema. It is authoritative: only its ownership field is
changed. The index name, storage type, prefixes, fields, explicit stopwords
and reported core vector settings, including the vector INDEXMISSING flag,
are checked against the live index before mutation. All vector tuning is taken
from the supplied source without comparison, even when FT.INFO reports it.
The source must also preserve phonetic matching, which FT.INFO does not expose.
Rebuilding an index with INDEXALL enabled requires manual migration.
Vector fields with INDEXMISSING also require manual index recreation when
rebuilding, because the current RedisVL serializer cannot encode that flag.
The operation is not transactional and has no automatic rollback. Re-run
marker backfills after interruption. completed reports marker writes,
not whether Redis has finished reindexing after the writes. Backfills update
only keys checked before the schema change; newly indexed documents are untouched.
Rebuild previews create and remove an empty probe index (without TEMPORARY)
to confirm that Redis accepts the supplied schema before replacing the live index.