Recommended approach for Data Migration

Hi @mathias-early-ravine ,

We recommend to do the migration in steps:

  1. Migrate models
  2. Write migration steps using DocumentAfterRepositoryLoadEvent event. This event is fired after the document is loaded but before it is deserialized. So this is your chance to change the document. The migration needs to work on the XML (or other format if you are using extensions) because the new models should already be used.
  3. Start server where the models are loaded and custom migration is executed.

An example how to do that can be found in our git respository for version 2023.02 please use branch release/35.0 : examples/examples-dataservices-init-app/src/main/java/com/mgmtp/a12/dataservices/example/migrations/MigrationStepFour.java?at=refs%2Fheads%2Frelease%2F35.0

Example shows that documents can be migrated one by one and the index can also be rebuilt model by model. You can also migrate everything in one migration step(if you prefer one transaction) and rebuild index afterwards.