The Dark Side of Event Sourcing: Managing Data Conversion is a good research paper covering the main strategies for versioning events.
- Multiple versions
- Lazy transformation
- In place transformation
- Copy and transformation
I wrote an Elixir library (eventstore-migrator) that implements the copy and transform strategy for my own event store. It copies and mutates events into a new PostgreSQL database. You can transform, remove, aggregate, and alter the serialization format of the events.
Here's an example of removing an unwanted event.
EventStore.Migrator.migrate(fn stream ->
fn (event_data) -> event_data.event_type == "UnwantedEvent" end
There are other examples in the README, including: upgrade an event; aggregate multiple events into one event; alter event serialization format.