Skip to content

Seed Files

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.

Clonit looks for a seed file named clonit-seed.yaml in the current working directory.

A seed file can contain two top-level sections: storage_profiles and targets.

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: 8

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)

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

Place the clonit-seed.yaml file in your current working directory and run the seed import command:

Terminal window
clonit seed import

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.

Share a clonit-seed.yaml file in your repository so new developers can quickly set up their local environment:

Terminal window
git clone https://github.com/your-org/your-repo.git
cd your-repo
clonit seed import

New team members get a fully configured Clonit setup with a single command.

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 mydb

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:

Terminal window
clonit seed import