Your RAG system is working. Documents are indexed, users are getting relevant results, and your application is serving production traffic.
Then you discover a better embedding model.
It offers stronger semantic retrieval, understands domain-specific language more accurately, or reduces the cost of generating embeddings. Upgrading sounds like a straightforward improvement. Replace the old model, regenerate the vectors, and continue serving searches.
But production systems are rarely that simple.
Your vector database may already contain millions of embeddings generated by the existing model. Those vectors represent documents in a particular embedding space. The new model has its own representation space, and its vectors cannot automatically be compared with the old ones.
You now face a difficult choice: keep using an outdated model or risk disrupting search while rebuilding the index.
Neither is a good production strategy.
The better approach is zero-downtime embedding migration: prepare the new embedding model and index alongside the existing system, move data without losing concurrent changes, evaluate retrieval quality, and switch production traffic only when the replacement is ready.
The challenge is not simply generating new vectors. It is keeping two versions of your search system consistent while real users continue querying and updating documents.
Why Changing an Embedding Model Can Break Your RAG System
An embedding model converts text into numerical vectors that capture semantic information. A RAG application uses these vectors to find documents related to a user's question.
For example, a user asks:
"How can employees request parental leave?"
The embedding model converts the question into a vector. The vector database compares it with stored document embeddings and retrieves relevant material, such as an HR policy or employee benefits guide.
This process works because the query and document embeddings belong to compatible representation spaces.
Now consider what happens when you replace the embedding model.
Your existing documents were converted using Model A. The new application generates query embeddings using Model B. Even when both models return vectors with the same number of dimensions, their representations are not necessarily compatible.
This is an important distinction.
Two embedding models can both produce 768-dimensional vectors and still represent the same sentence in completely different ways. Matching dimensions do not mean matching vector spaces.
Consequently, searching Model A's stored vectors using a Model B query embedding can produce misleading similarity results. Relevant documents may disappear from the top results, while unrelated documents may rank higher.
The problem is not necessarily the vector database. The problem is that the application is comparing representations that were not designed to work together.
When you change the embedding model, you must migrate the document embeddings and the query-embedding path together.
The Production Challenge: Your Search System Cannot Simply Stop
Imagine a RAG application storing five million documents.
Users are querying those documents throughout the day. New documents are being uploaded, existing documents are being edited, and some are being deleted.
Regenerating all five million embeddings takes time. Depending on the model, infrastructure, rate limits, and document volume, it could take hours or even days.
During that period, the application still needs to work.
A conventional migration might look like this:
- Stop accepting search requests.
- Rebuild the entire vector index with the new model.
- Replace the old index.
- Restart the search service.
This approach creates downtime and introduces another risk: changes made to source documents during the rebuild can be missed.
A zero-downtime migration takes a different approach. The existing search system remains active while the replacement is built independently.
Think of it as running two versions of your retrieval infrastructure:
| Existing system | Replacement system |
|---|---|
| Old embedding model | New embedding model |
| Existing vector index | New vector index |
| Continues serving users | Prepared in the background |
| Remains available for rollback | Evaluated before activation |
The old system protects production availability. The new system gives you a safe place to rebuild, test, and improve retrieval.
1. Build the New Index Without Touching Production Search
The first step is creating a separate destination for the new embeddings.
Suppose the existing system uses an embedding model that produces 768-dimensional vectors. You want to migrate to a model that produces 1024-dimensional vectors.
Keep the existing collection intact and create a replacement collection with the new model's vector configuration.
This separation is important for two reasons.
First, it prevents newly generated vectors from being mixed with embeddings produced by the old model. Second, it gives you an isolated environment where the new index can be rebuilt without affecting production queries.
There are two common approaches.
Blue-green migration
Maintain two separate vector indexes. The old index continues serving production traffic while the new one is populated and tested.
When the replacement is ready, switch the application to the new index. If something goes wrong, route traffic back to the old one.
Named-vector migration
Some vector databases support multiple named vectors for the same document. This allows a document to have separate embeddings generated by different models.
The application can select which vector representation to use during retrieval.
This approach can reduce the need for completely separate collections, but the implementation depends on the database's support for named vectors, indexing, and concurrent updates.
Qdrant documents both collection-based migration and named-vector migration. Weaviate also provides a vectorizer migration strategy.
The right choice depends on your database, dataset size, infrastructure, and rollback requirements.
2. Enable Dual Writes Before Rebuilding Existing Embeddings
Creating a new vector collection is straightforward. Keeping it synchronized with a live application is the real challenge.
Imagine you start migrating five million documents. While the background worker processes the existing dataset, users continue uploading new documents.
If your application writes those documents only to the old index, the new index will be incomplete when the migration finishes.
The solution is dual writing.
Whenever a document is created or updated, the application generates embeddings using both the old and new models and sends them to their respective indexes.
The old index continues serving users. The new index receives the same document changes in parallel.
This creates two synchronized search paths while the existing data is being migrated.
However, there is an important engineering detail: dual writes do not automatically guarantee consistency.
Consider a document update where the old embedding write succeeds but the new embedding write fails because the embedding API times out.
Your application now has two indexes containing different versions of the same document.
Silently ignoring this failure is dangerous. The migration might appear complete even though the replacement index contains missing or outdated records.
A stronger design uses a durable change-event mechanism, such as a message queue or transactional outbox.
When a document changes, the application records a corresponding event. Workers process that event, generate the required embeddings, and update the indexes. Failed operations remain available for retries.
Each operation should be idempotent, meaning that retrying it does not create duplicate or inconsistent records.
Also track the synchronization status of each document. The migration should not be considered complete until the replacement index has processed every relevant document change.
3. Re-Embed Millions of Documents Without Overloading the System
Once synchronization is active, the next task is rebuilding the existing dataset.
This is usually the most expensive stage of the migration.
A background worker reads existing documents, generates embeddings using the new model, and writes the results into the replacement index.
For large datasets, processing everything at once is a bad idea.
It can exhaust application memory, exceed embedding API limits, increase infrastructure costs, and compete with production workloads.
Instead, process documents in controlled batches.
The migration worker should support:
- Configurable batch sizes and concurrency.
- Rate limits for embedding generation.
- Retry handling with exponential backoff.
- Persistent checkpoints for recovery.
- Progress tracking and failure reporting.
- Separate monitoring for embedding and indexing operations.
There is another important detail: generate new embeddings from the original document content, not from the old vectors.
An embedding is a numerical representation of text. It is not a reliable backup from which the original document can be reconstructed.
The migration process must therefore have access to the original content or the canonical document representation used by the RAG ingestion pipeline.
Also preserve the existing chunking strategy when the objective is only to change the embedding model. Changing chunk sizes, overlap, and embedding models simultaneously makes it harder to identify why retrieval quality changed.
If the new model requires a different chunking strategy, treat that as a broader indexing migration and evaluate the two changes separately.
4. Updates and Deletes Can Quietly Corrupt Your New Index
This is one of the most easily overlooked parts of embedding migration.
Imagine the background worker reads a document while it is at revision 4. It starts generating a new embedding.
At the same time, someone edits the document. The application creates revision 5 and updates both indexes through the dual-write process.
A few seconds later, the background worker finishes processing revision 4 and writes it into the new index.
The result?
The new index now contains an older version of the document, even though the live application already wrote the latest version.
The same problem can occur with deletions. A document may be deleted while the backfill worker is processing it. If the worker does not check its current state, it could recreate a record that should no longer exist.
These are concurrency problems, not embedding problems.
Use document revisions
Every document should have a stable identifier and a revision number.
Whenever a document changes, its revision increases.
The migration worker should write an embedding only when its source revision is still current. Use conditional writes or reconciliation logic to prevent an older migration job from overwriting a newer document version.
Handle deletions explicitly
Document deletion should generate a durable event or tombstone.
The background worker must recognize that the source document is no longer active and avoid inserting it into the replacement index.
Both indexes should process deletion events during the migration so that the existing production path and the new path remain consistent.
Why this matters
A migration can report 100% completion and still contain stale documents.
A progress counter only tells you that the worker processed a certain number of records. It does not prove that the resulting index accurately represents the current source data.
This is why revision checks, deletion handling, and a final reconciliation pass are essential.
Qdrant's migration documentation specifically highlights the additional synchronization work needed for deletes and partial updates during migration.
5. Prove That the New Model Actually Improves Retrieval
Your new index is populated. All documents appear to be synchronized. It is tempting to switch production traffic immediately.
Don't.
A newer embedding model is not automatically a better embedding model for your application.
It might understand general language more effectively but perform worse on technical documentation, financial terminology, product names, or your particular domain.
You need to test retrieval quality using real application queries.
Start with a representative evaluation dataset containing:
- Actual user queries.
- Expected relevant documents.
- Queries from different subject areas.
- Difficult or ambiguous questions.
- Queries involving domain-specific terminology.
Run every query against both indexes using the corresponding embedding model.
Then compare the retrieved results.
Which retrieval metrics matter?
Recall@K
Measures how many of the relevant documents appear in the top K retrieved results. This is useful when missing an important document is costly.
Mean Reciprocal Rank (MRR)
Measures how high the first relevant result appears. A system that places the correct document first generally receives a better score.
Normalized Discounted Cumulative Gain (nDCG)
Evaluates ranking quality while accounting for different levels of relevance.
These metrics answer different questions, so don't judge the migration using only one of them.
Also measure p95 search latency, embedding generation cost, indexing throughput, and search failure rates.
Most importantly, investigate regressions by query category. An improved average metric can hide serious failures in a particular type of document.
One final warning: do not compare raw cosine similarity scores from two different embedding models as though they share the same scale. Compare their ranked results against labeled relevance data.
The purpose of this stage is not to prove that the new model is newer or more powerful. It is to prove that it works better for your users.
6. Run Shadow Traffic Before Changing the Production Index
Offline evaluation is necessary, but it cannot reproduce every condition found in a live system.
Production queries often have unusual wording, missing context, typos, domain-specific terms, and unexpected retrieval patterns.
This is where shadow traffic becomes valuable.
Instead of immediately serving users from the new index, duplicate selected search requests and send them to both systems.
The old index continues generating the actual user response. The new index processes the same query in the background, and its results are recorded for comparison.
This gives you a realistic view of how the replacement model performs without putting users at risk.
Once the results are stable, begin a gradual traffic rollout.
| Rollout stage | New index traffic |
|---|---|
| Initial rollout | 5% |
| Expanded rollout | 25% |
| Half traffic | 50% |
| Full migration | 100% |
These percentages are an example, not fixed requirements.
At each stage, monitor retrieval quality, latency, error rates, and user-visible answer quality.
If the new index begins returning poor results or experiencing failures, stop the rollout and investigate before increasing traffic.
A feature flag or search-router configuration makes this process easier to control.
7. Keep Rollback Available Until the New System Proves Itself
A safe migration should never depend on the assumption that everything will work perfectly.
The new model might perform well during evaluation but fail under real traffic. An indexing bug might affect a subset of documents. A provider outage could prevent the application from generating query embeddings.
The old index is your recovery path.
Keep the old model, its query configuration, and its vector index available throughout the migration's observation period.
A rollback must restore a compatible pair:
- Old embedding model for query generation.
- Old vector index for document retrieval.
Switching only one of these components can break search again.
Also consider what happens to new document updates during rollback. If you stop maintaining the old index too early, it may no longer contain the latest version of every document.
Keep the old path synchronized until the new system has remained stable long enough that rollback is no longer necessary.
Only then should you stop old-model writes and remove the old index.
8. Know When the Migration Is Actually Complete
Generating all the new vectors is not the finish line.
Before removing the old index, verify that the replacement represents the current state of your source documents and behaves reliably under production conditions.
Use a final migration checklist:
| Validation | Expected result |
|---|---|
| Existing documents | All required documents have new embeddings |
| New uploads | Successfully indexed with the new model |
| Document updates | Latest revision is searchable |
| Document deletions | Removed from active retrieval |
| Failed jobs | Resolved or explicitly accounted for |
| Retrieval evaluation | Meets agreed quality thresholds |
| Production traffic | Stable under the new index |
| Rollback | Tested and no longer required |
Only after these checks pass should the old infrastructure be retired.
For large systems, keep the migration records and evaluation results. They provide a useful baseline for the next time your embedding model changes.
Common Mistakes That Make Embedding Migration Risky
Mixing embeddings from different models
Matching vector dimensions do not establish compatibility. Keep the old and new representations isolated unless your vector database explicitly supports separate named vectors.
Rebuilding without dual writes
New or updated documents can be missing from the replacement index by the time backfill finishes.
Ignoring concurrent updates and deletions
A migration worker can overwrite newer content or resurrect deleted documents if revision checks and deletion handling are missing.
Treating migration completion as quality improvement
A fully populated index can still produce worse search results. Retrieval evaluation must happen before traffic cutover.
Comparing similarity scores instead of retrieval quality
Similarity values from different models are not directly interchangeable. Compare ranked results using a shared evaluation dataset.
Deleting the old index immediately after switching
Without a tested rollback path and a sufficient observation period, a bad migration can become a production outage.
Final Thoughts
Embedding model upgrades are inevitable as RAG applications evolve. Better models become available, application requirements change, and teams need to improve retrieval quality or reduce infrastructure costs.
But a production embedding migration should never be treated as a simple model replacement.
The difficult work happens around the model: keeping indexes synchronized, protecting concurrent updates, handling deletions, measuring retrieval quality, and ensuring the application can recover when something goes wrong.
A reliable migration follows a controlled process:
Build the new index, synchronize live changes, regenerate existing embeddings, reconcile document revisions, evaluate retrieval quality, shift traffic gradually, and preserve rollback until the replacement is proven.
The most important lesson is that an embedding migration is a production data migration, not merely a machine learning configuration change.
Treat it with the same discipline as a database migration, and your RAG system can evolve without making search unavailable to the people who depend on it.



