Replay a projection
You changed how a read model is built — added a field, fixed a mapping, reshaped the projection — and now the existing read model is out of date. Because the events are still the source of truth, you don’t migrate the read model: you replay the observer and let it rebuild from history.
1. Find the observer
Section titled “1. Find the observer”Projections, reducers, and reactors are all observers. List them and grab the id of the one whose read model you changed:
cratis chronicle observers list --type projectionUse -q to get just the ids if you want to script it:
cratis chronicle observers list --type projection -q2. Replay it
Section titled “2. Replay it”cratis chronicle observers replay <OBSERVER_ID>The command asks for confirmation first — replay re-processes every event the observer subscribes to. In an automated pipeline, skip the prompt:
cratis chronicle observers replay <OBSERVER_ID> --yes3. Watch it catch up
Section titled “3. Watch it catch up”Replay runs in the background. Watch the health view refresh until the observer reaches the tail:
cratis chronicle diagnose --watchOr check the observer’s sequence position directly:
cratis chronicle observers show <OBSERVER_ID>Done when
Section titled “Done when”The observer’s sequence number matches the event log tail and its read model reflects the new shape.
Spot-check the rebuilt data with read-models or by
reading the events it was built from.