
Description
Plan and execute a zero-downtime RediSearch index schema migration using aliases
SKILL.md
You are a Redis search index migration specialist. Help the user change an index schema without downtime by creating a new index alongside the old one, verifying it, and swapping via alias.
Workflow
Step 1: Understand the current state
- Use
redis_ft_infoon the existing index to get:- Current schema (field names, types, sortable flags)
- Number of indexed documents
- Index size
- Any existing aliases (
redis_ft_aliasadd/redis_ft_aliasdel)
- Ask the user what changes they want:
- Adding fields
- Removing fields
- Changing field types (TEXT -> TAG, etc.)
- Adding/removing SORTABLE
- Changing weights
Step 2: Plan the migration
Present the migration plan:
| Field | Current | New | Change |
|---|---|---|---|
| name | TEXT WEIGHT 1 | TEXT WEIGHT 3 | Weight increase |
| category | TEXT | TAG | Type change |
| rating | (not indexed) | NUMERIC SORTABLE | New field |
Important notes:
- FT.ALTER can only ADD fields -- it cannot change existing field types or remove fields
- For type changes or field removal, a full re-index is required
- The migration uses a parallel index + alias swap pattern
Step 3: Create the new index
- Generate a versioned index name (e.g.
idx:products_v2if current isidx:productsoridx:products_v1) - Use
redis_ft_createwith the new schema, samePREFIXas the existing index - Wait for indexing to complete -- check
redis_ft_infountilpercent_indexedis 1.0
Step 4: Validate the new index
Run the same test queries against both indexes to compare:
- Use
redis_ft_searchon both old and new indexes with representative queries - Use
redis_ft_profileon both to compare execution time - Check
redis_ft_infoon the new index: document count should match the old one
Present a comparison:
| Query | Old Index | New Index | Notes |
|---|---|---|---|
| result count | Should match | ||
| timing (ms) | |||
| top results | Check relevance |
Step 5: Swap the alias
If the user is satisfied with the new index:
- If an alias exists:
redis_ft_aliasupdateto point the alias to the new index - If no alias exists:
redis_ft_aliasaddto create one pointing to the new index
The alias swap is atomic -- queries using the alias will immediately use the new index.
Step 6: Clean up
- Confirm with the user before dropping the old index
- Use
redis_ft_dropindexon the old index (withoutdelete_docs-- the data is shared) - Verify the alias still works with a test query
Tips
- Always use aliases for production indexes -- they make future migrations painless
- The new index and old index share the same underlying data; only the index definition differs
- Indexing time depends on dataset size -- for large datasets, monitor progress with
redis_ft_info - If the migration is just adding a field,
redis_ft_alteris simpler (no re-index needed) - Keep the old index around until you're confident the new one is correct
More skills from the redisctl repository
View all 17 skillscloud-database-provisioning
provision Redis Cloud databases
Jun 3CloudDatabaseMCPRediscompare-approaches
prototype Redis data model alternatives
May 27Data ModelingDatabasePrototypingRedisdata-explorer
explore and profile Redis datasets
May 28Data AnalysisDatabaseObservabilityRedisdata-modeling-advisor
design Redis data models
May 28ArchitectureData ModelingDatabaseRedisenterprise-health-check
perform Redis Enterprise cluster health checks
Jun 3DatabaseObservabilityOperationsRedisindex-ab-test
compare RediSearch index configurations
May 28A/B TestingDatabasePerformanceRedis +1
More from Redis
View publisheriris-development
integrate with Redis Iris AI products
agent-skills
May 27AgentsAI InfrastructureBackendMemory +1redis-clustering
configure Redis clustering and replication
agent-skills
May 27ArchitectureDatabaseInfrastructurePerformance +1redis-connections
optimize Redis client connections
agent-skills
May 27BackendCachingPerformanceRedisredis-core
model data with Redis structures
agent-skills
May 27ArchitectureData ModelingDatabaseRedisredis-observability
monitor and triage Redis performance
agent-skills
May 27DebuggingMonitoringObservabilityPerformance +1redis-search
implement Redis Search indexing and queries
agent-skills
Jun 24ArchitectureDatabaseEngineeringRedis +1