Retiring the old system
The previous setup’s images, volumes and stack files stayed untouched through the whole rebuild, as a reference. Retiring them is the final phase, and it waits until the new system has run cleanly for a while and backups have been test-restored.
The procedure
Section titled “The procedure”-
Inventory. For each old image and volume: what replaced it, or “not restored”, with its size from
docker system df -v. -
Decide per item — keep, archive, or delete. Data that isn’t yours to keep is deleted, not archived.
-
Archive first. The pre-rebuild tarballs plus
docker saveof any image worth keeping, copied off the server. -
Remove by name only:
Terminal window docker image rm <ref>docker volume rm <name>Never a blanket
docker system prune— it can’t tell the old system from the new one.
Other loose ends
Section titled “Other loose ends”- Edit backups left on the server while fixing configs (
*.orig-*,*.bak*). - Old
.envbackups that still contain a revoked token. - Push the infra repo’s fixes upstream (they’re on a local branch).