# Moving from Perforce

If your team runs Perforce (Helix Core) today, most of Swarmfile will feel familiar: changelists, exclusive checkouts of binary files, stream-style branches, review before a change lands. The big difference is that there's no workspace to sync. Your repository is a **mounted drive**: files stream on demand, and a save is on its way to the team the moment you make it.

This page maps Perforce concepts onto Swarmfile, explains how to bring a depot across, and is direct about what doesn't carry over.

## Concept map

| Perforce | Swarmfile | Notes |
|---|---|---|
| Server / depot | Organization / **repository** | A repository is the unit of storage, history, and permissions. |
| Stream | **Branch** | Branches follow the streams model: a full working line over shared, content-addressed storage. Forking a branch copies no file data. See [Branches & Merging](https://swarmfile.com/docs/guides/branches-and-merging). |
| Workspace (client spec) + `p4 sync` | **The mounted drive** - no sync | Files appear on demand and stay current as teammates save. There's no client view to maintain and no sync to run. `swarmfile switch <branch>` moves a mount to another branch in place. |
| `p4 edit` / `p4 add` / `p4 delete` | Just open, save, create, or delete on the drive | Every change is tracked automatically. |
| Pending changelist | **Changelist** | Open one with `swarmfile changelist open -m "…"`; saves stage into it until you submit. You can hold several at once and choose which is current, like `p4 … -c`. See [Version Control](https://swarmfile.com/docs/guides/version-control#mode-b-staged-explicit-submit). |
| `p4 submit` | `swarmfile changelist submit` (or `swarmfile commit -m "…"`) | Applies atomically. Repositories can also run in the default auto-landed mode, where each save lands as it's made and you name commits when it suits you. |
| Submitted changelist number | **Commit** number (`#482`) | `swarmfile log`, `swarmfile show 482`, `swarmfile diff`. |
| `p4 shelve` / `p4 unshelve` | **Park** / **resume** | `swarmfile changelist park` sets aside every open changelist on the mount (kept on the server); `changelist resume` brings it back. See [Setting work aside](https://swarmfile.com/docs/guides/version-control#setting-work-aside). |
| Exclusive checkout (`+l` filetype, `p4 lock`) | **Edit lock** | `swarmfile lock <path>` reserves a file for up to 30 days (7 by default); others can ask for it back with `swarmfile unlock-request create <path>`. See [Entry locks](https://swarmfile.com/docs/guides/working-with-files#entry-locks). |
| Revit / SolidWorks exclusive open | **Worksharing**, no plugin | On Windows, the application's own exclusive open is enforced across machines. See [Worksharing](https://swarmfile.com/docs/guides/worksharing). |
| `p4 opened` / who has it | **Presence** | See who has a file open or locked, in the dashboard and the Desktop App. |
| Working disconnected | **Pack & Go** | Reserve a folder or repository for offline editing and land the changes when you're back. See [Working Offline](https://swarmfile.com/docs/guides/offline-working). |
| `p4 undo` / rollback | `swarmfile revert`, `swarmfile restore`, `swarmfile rollback` | Revert a commit, restore a file, folder, or repository to a past point - each as a new, undoable commit. See [Trash, History & Rollback](https://swarmfile.com/docs/guides/trash-history-and-rollback). |
| Labels | **Tags** | `swarmfile tag create v1.0` - an immutable name for a commit. |
| Protections table | **Folder and file ACLs** | Allow/deny read, write, or admin, inherited down the tree. See [Permissions](https://swarmfile.com/docs/admin/permissions). |
| Helix Swarm review | **Merge requests** | Review on a branch before it lands, with approvals, requested reviewers, and diffs. **Protected branches** refuse changes that haven't come through an approved merge request, and protection rules can request reviewers automatically (CODEOWNERS-style). |
| Triggers | **Webhooks** and the **runner** | Signed [webhooks](https://swarmfile.com/docs/admin/webhooks) on commits, merges, and more; the [runner](https://swarmfile.com/docs/guides/runner-as-ci) runs jobs on a branch when a commit or tag lands. |
| Proxy / edge server | **LAN-first peers** and **seed nodes** | Machines in the same office share data directly; a [seed node](https://swarmfile.com/docs/admin/self-hosted-seed-nodes) on your own hardware keeps a warm local copy. |

## Bringing a depot across

**There's no Perforce history importer.** Swarmfile can't read a Perforce server's revision history and replay it as commits. What you can bring across is the **current state** of a depot or stream, and that's usually what a team needs to start working.

1. **Get the head revision on disk.** In a Perforce workspace that maps the depot or stream you're moving, `p4 sync` to the revision you want to start from.
2. **Create the Swarmfile repository**, and decide its branches (one per stream you're moving, usually starting with `main`).
3. **Import with `swarmfile-migrate`.** Dry-run first to check what would be imported and that your excludes are right:

   ```bash
   swarmfile-migrate --source /p4/workspaces/game-main \
     --org-id acme-games --repository-id game \
     --exclude ".p4config" --exclude "**/.p4ignore" \
     --dry-run

   swarmfile-migrate --source /p4/workspaces/game-main \
     --org-id acme-games --repository-id game \
     --exclude ".p4config" --exclude "**/.p4ignore" \
     --state-db ./migrate-state.db --report-json ./migrate-report.json
   ```

   `--state-db` makes a large import resumable, each file is checked against the source after upload (on by default; `--verify=false` skips it), and `--report-json` gives you a record of everything that arrived. The [`swarmfile-migrate` reference](https://swarmfile.com/docs/cli/swarmfile-migrate) has every flag, and [Migrating Existing Data](https://swarmfile.com/docs/guides/migrating-existing-data) walks through a full run.
4. **Commit and tag the import** (for example `swarmfile tag create imported-from-p4`) so there's a named starting point.
5. **Recreate permissions and exclusive-checkout habits**: ACLs for restricted folders, and edit locks (or Windows worksharing) for the binary files your team used to `+l`.
6. **Keep Perforce read-only for older history.** Leave the server up in read-only mode (or archive it) for as long as you need to look up who changed what before the move. Swarmfile's history starts at the import.

Moving one stream at a time works fine; Swarmfile doesn't need to own the whole depot on day one.

## Where it's genuinely different

- **No sync, no have-list.** You never decide which revision your workspace holds; the drive shows the branch as it is. Large files you haven't opened take no disk space until you do. To keep a set of files local for the road, use [Pack & Go](https://swarmfile.com/docs/guides/offline-working).
- **Saves are shared immediately by default.** Perforce shares nothing until submit. Swarmfile's default mode lands each save as it's made; switch a repository to staged mode, or open a changelist, when you want Perforce-style batching.
- **History moves forward.** Reverts, restores, and rollbacks are recorded as new commits rather than edits to old ones, and `commit --amend` changes only a message.
- **Whole-file versions.** Like Perforce for binaries, every version is a whole file (stored deduplicated, so unchanged parts of a large file cost nothing to keep).

## Not supported

- **No Perforce history importer.** Import the head revision as above and keep the old server for history.
- **No game-engine source-control plugins.** There's no Unreal Editor or Unity source-control provider for Swarmfile, so the editors' built-in check-out and submit buttons don't talk to it. Teams work on the mounted drive directly and use the Desktop App or the `swarmfile` CLI for locks and commits.
- **No Perforce-compatible commands.** The `swarmfile` CLI uses its own verbs (and understands many git habits, see [Coming from Git](https://swarmfile.com/docs/guides/coming-from-git)); it doesn't accept `p4` command lines.

If one of these is a blocker for your move, [tell us](https://swarmfile.com/contact) - it helps us decide what to build next.
