make migrate-safe runs from the new release's image (#1045) #1062
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/1045-migrate-safe-new-release"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #1045. The owner's answer to Q146 (D274).
Summary
make migrate-saferan its preflight, backup and migration withdocker compose exec backend, which is the container that is running now: on an upgrade it checked and migrated with the old release's code. It now runs them from the release about to start, and touches no running service.scripts/migrate-safe.sh(POSIX sh), called by the Makefile target:docker compose pullon an image host,docker compose buildon a source build. Which one is asked of compose itself: whether the rendered config gives themigrateservice abuild:section.backendcontainers: the same user and./backupsmount asmake backup-now, so the dump lands where that one writes, owned the same way.migratecontainer, run as that service's own command, so its backups-directory preparation and migrate credentials are used as they stand.Every step is
run --rm --no-deps, so db and redis are not touched. The script stops at the first failure and names the step.Docs.
docs/OPERATIONS.md(install, Updating Production, Running from Published Images, Safety rules), the comment by themigrateservice, and the profile's prod-deploy line now recommend the command. #1044 had told image hosts not to use it.Changelog
changelog.d/1045-migrate-safe-new-release.fixed.mdTest plan
Proved on docker-test in a throwaway compose project, with no published ports and a dummy
.env; the dev stack was not touched.COMPOSE_FILEwith the images overlay,4.5.0-rc2):runcontainers;./backups;makeexited non-zero, and nothing after it ran.🤖 Generated with Claude Code