ADD A NAMESPACE TO AN EXISTING REPOSITORY
This guide shows you how to assign a namespace to an existing solo repository and migrate its data to the namespaced directory layout.
Prerequisites
- A swamp repository with existing data
- The repository should already be configured with a shared datastore backend (S3 or GCS) if you plan to share data with other repositories. Filesystem datastores also support namespaces.
Assign the namespace
$ swamp datastore namespace set infraNamespace set to "infra"
Datastore: .../.swamp
Warning: Existing data remains at the old un-namespaced path.
Run 'swamp datastore namespace migrate --confirm' to move it
to the namespaced layout.The namespace is recorded in .swamp.yaml but existing data has not moved yet.
Preview the migration
Before moving data, preview what will change:
$ swamp datastore namespace migrateMigration preview (namespace: "infra")
definitions-evaluated
.../.swamp/definitions-evaluated
→ .../.swamp/infra/definitions-evaluated
12 file(s), 48 KB
data
.../.swamp/data
→ .../.swamp/infra/data
85 file(s), 2.1 MB
...
Total: 142 file(s), 3.8 MB
Add --confirm to execute this migration.The preview shows every directory that will move, the target path, and the total file count and size. No data is modified.
Execute the migration
$ swamp datastore namespace migrate --confirmEach directory is moved to the namespace-scoped path. The catalog is invalidated and rebuilt on the next access.
Verify
$ swamp datastore namespace list┌───────────┬──────────────────────────────────────┬──────────────┬─────────┐
│ namespace │ repoId │ registeredAt │ current │
├───────────┼──────────────────────────────────────┼──────────────┼─────────┤
│ infra │ <repo-uuid> │ 2026-06-04 │ * │
└───────────┴──────────────────────────────────────┴──────────────┴─────────┘Existing CEL expressions continue to work — point lookups (data.latest,
data.version) implicitly scope to the current namespace.