Browse docs
Docs / CLI Reference / swarmfile-migrate

swarmfile-migrate

swarmfile-migrate bulk-imports data you already have into a Swarmfile project: a local directory, a flat list of file paths, or an S3-compatible bucket. It's a standalone binary - no running engine required - meant for the first-time import of an existing archive, not for day-to-day file operations.

This page is the flag reference. For a practical walkthrough with a worked example, see Migrating Existing Data.

Run with --dry-run first. It walks the source and reports what would be migrated without uploading anything, which is the safe way to check your exclude patterns and source/destination settings before committing to a real run.

Source selection#

Pick exactly one source: a local directory, a flat file list, or an S3-compatible bucket.

FlagDescription
--sourceLocal directory source
--source-listFlat file-list source
--source-rootRoot to resolve relative paths in --source-list against
--source-s3-bucketS3-compatible source bucket
--source-s3-prefixPrefix within the S3 bucket to migrate
--source-s3-endpointS3-compatible endpoint URL
--source-s3-regionDefault us-east-1

Destination#

FlagDescription
--root-pathDestination path inside the project. Default /
--hub-urlYour hub URL, e.g. https://hub.swarmfile.com (or your self-hosted hub's URL). Defaults to $SWARMFILE_HUB_URL if set, otherwise the hosted hub (https://hub.swarmfile.com) - so a machine whose environment already names its hub does not need this flag
--org-idTarget organization
--project-idTarget project
--oidc-issuerOIDC issuer for authenticated hub access
--oidc-client-idOIDC client ID
--oidc-refresh-tokenOIDC refresh token

Exclusions#

FlagDescription
--excludeGitignore-style exclude pattern. Repeatable.
--exclude-fromFile containing exclude patterns, one per line

Reliability#

FlagDescription
--concurrencyFile-level concurrency. Default 8
--block-concurrencyBlock-upload concurrency per file. Default 4
--retryRetry attempts per failed transfer. Default 0
--verifyVerify each upload against the source with a CID/hash comparison
--state-dbLocal state DB path. Tracks what's already uploaded and enables resuming a re-run
--report-jsonWrite a JSON report of the run
--start-atResume marker to start from

Safety#

FlagDescription
--dry-runReport what would be migrated without uploading anything
--forceRe-migrate files already registered/uploaded in a prior run, instead of skipping them

Examples#

Local directory, skipping cache and scratch files, with post-upload verification:

swarmfile-migrate --source /Volumes/nas/ProjectArchive \
  --hub-url https://hub.swarmfile.com \
  --org-id acme-films --project-id feature-01 \
  --exclude "*.cache" --exclude "**/tmp/**" \
  --state-db ./migrate-state.db \
  --verify

S3-compatible bucket, previewed with --dry-run before the real run:

swarmfile-migrate --source-s3-bucket project-archive \
  --source-s3-prefix renders/2025 \
  --source-s3-endpoint https://s3.us-west-000.backblazeb2.com \
  --hub-url https://hub.swarmfile.com \
  --org-id acme-films --project-id feature-01 \
  --dry-run