2026 06 07 Sparse Checkout Migration
What happened¶
Wanted to pull the latest hosts/centuries/ folder from the_codex monorepo onto centuries. Discovered that /srv/docker/compose was already a git remote pointing at the_codex, but had no sparse checkout configured — a plain git pull would have dumped the entire repo (ansible, harbinger, etc.) into the compose directory.
What we did¶
- Ran
git sparse-checkout init --coneandgit sparse-checkout set hosts/centuries - Hit a blocker: two locally modified files (
arr_stack/docker-compose.yml,traefik/docker-compose.yml) were outside the sparse pattern and couldn't be staged normally - Used
git add --sparseto force-stage them, committed, then pulled - Ran
git sparse-checkout reapplyto clean up
What broke¶
.env files for services other than arr_stack and traefik were lost. When sparse checkout removed the tracked docker-compose.yml files from the old flat directories (e.g. /srv/docker/compose/openwebui/), it also deleted the directories — taking the untracked .env files with them.
Affected services: openwebui, mealie, n8n, netbox, newt, semaphore, vaultwarden, adguard-sync, arcane (anything that had a .env at the old root level)
How we recovered¶
Restored .env files from backup and placed them at the new paths:
Also had a brief Pangolin routing issue for chat.sqrd.link — wrong resource config, fixed manually in the Pangolin UI.
Lessons learned¶
- Before any sparse checkout migration, explicitly move all
.envfiles first — git will silently delete them when it cleans up directories containing only untracked files - Always run
find /srv/docker -name ".env"before and after to diff what's present - Backups saved the day —
.envfiles are gitignored so they're never in git history
New file structure on centuries¶
Compose files now live at:
Update any Semaphore playbooks or scripts that referenced the old flat paths.