Relationships
#3238 datastore setup filesystem back to the default .swamp copies 0 files from the current datastore and exits 0, leaving the repo's data unreachable
Opened by taylor · 10/11/2026· Shipped 10/11/2026
What happens
After moving a repo's datastore to an external filesystem path, running swamp datastore setup filesystem to move it back to the repo's default .swamp directory switches .swamp.yaml to the new path but copies nothing from the current datastore. It reports success with filesCopied: 0, directoriesMigrated: [] and errors: [], and exits 0.
Afterwards swamp reads the nearly empty local .swamp, so all model data appears to be gone (swamp data query 'model("<name>")' returns 0 results) while the data still sits at the old external path. Nothing is deleted, but nothing warns that the data was left behind either.
Steps to reproduce
Swamp 20261009.215038.0, macOS. The external path here was an SMB mount, but any directory outside the repo should do.
# repo with some model data in the default .swamp, no datastore block in .swamp.yaml
swamp datastore setup filesystem --path /Volumes/NAS/test --json
# -> filesCopied: 131, directoriesMigrated: [definitions-evaluated, workflows-evaluated, data, outputs, workflow-runs, audit]
# data is moved: local .swamp drops from 17M to 1.1M
swamp datastore setup filesystem --path "$PWD/.swamp" --json
# -> {"type":"filesystem","path":".../.swamp","filesCopied":0,"filesPulled":0,"bytesCopied":0,
# "directoriesMigrated":[],"errors":[],"warnings":[]} exit 0
swamp data query 'model("<name>")' --json # -> 0 results
du -sh .swamp /Volumes/NAS/test # -> 1.1M local, 17M still on the external path.swamp.yaml now has datastore: { type: filesystem, path: $HOME/.../.swamp }, so swamp no longer looks at the external path.
Expected
Moving the datastore from any current location to any new location, including back to the default .swamp, should copy the current datastore's contents to the destination, the same as the first move did. Failing that, setup should refuse or warn that the existing data at the current path will not be migrated, rather than reporting success.
Workaround
Copy the data back by hand (rsync -a /Volumes/NAS/test/ .swamp/), restore .swamp.yaml to its original contents (no datastore block), then run swamp doctor datastores --repair -y. That step was needed because the catalog copied from the external datastore was missing rows for data written while the datastore was external (12 records on disk, 10 in the catalog).
Possibly related
#3162 (shipped): setup with --path .swamp in a repo that was never moved. If that fix skips migration whenever the destination resolves to the default .swamp, rather than comparing against the current datastore path, it would explain this behaviour. Not verified.
Shipped
Click a lifecycle step above to view its details.
stack72 commented 10/11/2026, 10:55:58 PM
Thanks @taylor for reporting this! We shipped: Datastore setup reads the data it moves from the repo's own .swamp unless the current datastore is a remote extension. When the current datastore is a filesystem path outside the repo, setup ignores that path. Moving back to .swamp copies nothing, and moving to another path or to S3 copies the near-empty .swamp, both reported as success. Make setup read from the current datastore's root, and refuse when that root is missing or the destination is nested in a migrated subdir. Never copy the catalog, and delete it after a successful move so it rebuilds. Verify that every source entry arrived instead of comparing counts. Compare the #3162 same-path guard against the real source. Also make doctor datastores check catalog completeness against the datastore's data dir, so it can detect a stale catalog for an external datastore.. The fix has been merged and a release is on its way. We appreciate your contribution to swamp.
Sign in to post a ripple.