Error in Sequential Migrations with Model Changes – Index-Database Synchronization Fails

Hello everyone,

We are encountering a recurring issue when executing multiple sequential migrations with model and document changes in a single branch.
The scenario can be simplified as follows:

  1. Migration 1
  • Removes an existing field from the document
  • Additional changes …
  1. Migration 2
  • Adds a new field to the document

When this migration sequence is executed, the process fails during the Index-Database Synchronization step with the following error:

Deserialization of document has failed. 
Reason: For the entity instance '/Path/…', the corresponding entity was not found 
in the corresponding document model. [ERROR,L0,s0,e0]

Observations:

  • The error occurs only when the second migration contains document changes that depend on the modifications made in the first migration.
  • It appears that during synchronization, a document deserialization step attempts to access an outdated or incompatible model.
  • This issue prevents us from running multiple migrations in one go, which is necessary for our incremental rollout process.

Questions to the community:

  1. Is there a way to adjust the Initialization Sequence so that document migrations are processed in the correct order?
  2. Are there best practices for structuring model changes between migrations so that deserialization does not fail?

Thanks in advance for any guidance or shared experiences!

Hi @anon55280409,
Have you had a chance to look at the migration example from Data Services?
I noticed that it uses the @Order annotation, which allows you to specify the execution order of each migration (GetA12 Migration Execution).

Hello @thien-nimble-cursor , I am a member of the Discourse team. I can see that there was a new response to your question on the Topic of the discussion. Do you find it helpful, or should the question remain open?

Thanks ahead for your feedback and have a nice rest of the day!