Seed Files
Overview
Section titled “Overview”Seed files let you bootstrap targets and storage profiles from a YAML file, providing a repeatable and shareable way to configure Clonit. Instead of running multiple targets add and storage-profile add commands, you define everything in a single file and import it.
Seed File Location
Section titled “Seed File Location”Clonit looks for a seed file named clonit-seed.yaml in the current working directory.
Seed File Format
Section titled “Seed File Format”A seed file can contain two top-level sections: storage_profiles and targets.
Full Example
Section titled “Full Example”storage_profiles: my-s3: provider: s3 access_key: "AKIA..." secret_key: "secret..." region: us-east-1 bucket: my-snapshots
targets: mydb: db_type: postgres src_url: "postgres://user:pass@host/db" dst_url: "postgres://user:pass@localhost/db_dev" storage_profile: my-s3 dump_jobs: 8Storage profiles section
Section titled “Storage profiles section”Each key under storage_profiles is the profile name. Supported fields include:
| Field | Description |
|---|---|
provider |
Storage provider (s3, r2) |
access_key |
Access key for authentication |
secret_key |
Secret key for authentication |
region |
AWS region (for S3) |
bucket |
Bucket name |
account_id |
Cloudflare account ID (for R2) |
endpoint |
Custom S3-compatible endpoint URL |
prefix |
Key prefix for organizing objects |
awscli_profile |
AWS CLI profile name (alternative to explicit keys) |
Targets section
Section titled “Targets section”Each key under targets is the target name. Supported fields include:
| Field | Description |
|---|---|
db_type |
Database type (postgres) |
src_url |
Source database connection URL |
dst_url |
Destination database connection URL |
storage_profile |
Name of a storage profile to associate with this target |
dump_jobs |
Number of parallel dump jobs |
sanitize_dst_url |
Sanitization database connection URL |
sanitize_query_file |
Path to the sanitization SQL file |
Importing a Seed File
Section titled “Importing a Seed File”Place the clonit-seed.yaml file in your current working directory and run the seed import command:
clonit seed importIdempotent Imports
Section titled “Idempotent Imports”Seed imports are idempotent – records are only created if they do not already exist. If a target or storage profile with the same name already exists, it is skipped. This means you can safely run the seed import multiple times without duplicating data or overwriting existing configuration.
Use Cases
Section titled “Use Cases”Team onboarding
Section titled “Team onboarding”Share a clonit-seed.yaml file in your repository so new developers can quickly set up their local environment:
git clone https://github.com/your-org/your-repo.gitcd your-repoclonit seed importNew team members get a fully configured Clonit setup with a single command.
CI/CD pipelines
Section titled “CI/CD pipelines”Use seed files to configure targets and storage profiles in automated pipelines. Include the seed file in your CI/CD configuration and run the import as a setup step:
# Example CI step- name: Configure Clonit run: | cp ci/clonit-seed.yaml clonit-seed.yaml clonit seed import clonit pull mydb clonit load mydbDisaster recovery
Section titled “Disaster recovery”Maintain a seed file as a backup of your target and storage profile configuration. If you need to set up Clonit on a new machine or recover from a configuration loss, import the seed file to restore your setup:
clonit seed import