Database Migration (Event versioning) what should be considered?


I am currently in a situation where I will need to do a database migration. The reason is because we had to update the structure of an event, but upcasting isn’t enough, because the default value for the new event comes from a set of a projection of values from events in the same stream.

I was considering using the transformation provided by the Replicator tool, but as far as I understand it can not hold state across event processing it only knows about the current event it is processing.

Therefore, in order to do this kind of migration I would need to build my own tool, I was wondering what kind of things I should be careful about when migrating the db. I know for example about the CreatedData, this is dealt with by the replication with “originalCreatedDate”.

Are there other things I should be careful about? Or can I just rea the $all stream from the source db and and write it in the new db?

Thank you very much!