# Migrations Migrations convert existing installations when a release changes the shape of something in `data/`. They ship **inside** the release package and run automatically as part of the post-update step, right after the files are deployed and before `shopAfterUpdate()`. Which migrations have already run is recorded in `data/manage/migrations.json`, which is never part of a release. Pending migrations are listed on *Admin → Einstellungen* and can be re-run from there after a failure. ## When you need one Only for changes that existing data cannot survive on its own. Adding a new optional field with a sensible default is handled by `normalizeProductRecord()` and friends in `includes/functions.php` — that needs no migration. Renaming a field, splitting one file into two, or changing a value format does. ## Naming ``` YYYY-MM-DD-NN-short-slug.php ``` for example `2026-08-21-01-add-category-id.php`. Files run in filename order, so the date prefix and the two-digit counter decide the sequence. **The filename without `.php` is the migration id** — renaming an applied migration makes it run again. ## Shape Return a closure. (A file defining a global `up()` also works, but two such files in one run would collide.) ```php