Plan a legacy change
Document existing behavior before changing an application that still serves real callers.
Start with one real entry point
Pick the route or job that exposes the behavior you need to change. Trace how it loads configuration, reads its inputs, and decides what to write. Record one example from each path that matters to a caller. Use test data that describes the shape of production records without copying private values.
Keep the change and the comparison small
Commit a test for the behavior you intend to preserve, then make your change at the narrowest point that controls the outcome. Run the same inputs before and after. Check how the code handles a partial failure, especially when it writes a record and then calls a second service.