Agent Wranglers

DAT-24Recommended

Test migrations on a copy of production data

Run each migration on a recent copy of production data before it reaches production, and time it.

How to do it

Restore last night's backup to a throwaway database inside the production account, with production's access controls, and delete it after the run. This is not staging, so personal data never leaves production. Or use a masked copy. Run the pending migrations and the test suite. Production data finds the rows that break a new constraint, and the time shows how long locks last.

How to check

The deploy pipeline shows a passed migration run on the copy, with its duration, before the production step.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/data/migrations/test-migrations">Agent Wranglers data and databases playbook</a>. In code you write, add a comment next to it with the same link.