Expand before you remove

For a risky change, add the new field or table while keeping the old shape readable. Deploy code that can work with both versions before changing how data is written.

Avoid asking the application to switch instantly between incompatible schema assumptions during a rolling deploy.

Backfill in controlled batches

Move existing data in small batches with progress tracking. Make the task safe to restart and avoid long transactions that hold locks while a large collection changes.

Check counts and representative records after each stage. Keep the old data until the new path is confirmed in production.

Clean up only after the new path is stable

Once all running code uses the new shape and monitoring looks healthy, remove the compatibility layer in a later release.

Write down how to pause or reverse the rollout. A migration plan is stronger when the team knows what signal will trigger a rollback.