Quick Start
This guide walks through the full first-use workflow: initializing Clonit, adding a target, building a snapshot, and loading it into a destination database.
Step 1: Initialize
Section titled “Step 1: Initialize”Run config init to create the configuration file and SQLite metadata database:
clonit config initThis creates:
~/.config/clonit/config.yamlwith an auto-generated secret key~/.config/clonit/clonit.dbSQLite database for metadata
Step 2: Add a Target
Section titled “Step 2: Add a Target”A target defines a source database to snapshot and an optional destination database to load into:
clonit targets add \ --name mydb \ --src-url "postgres://user:pass@srchost:5432/mydb" \ --dst-url "postgres://user:pass@localhost:5432/mydb_dev"The source and destination URLs are encrypted at rest in the SQLite database using the secret key from your config.
Step 3: Verify Connectivity
Section titled “Step 3: Verify Connectivity”Confirm that Clonit can reach both the source and destination databases, and that your local PostgreSQL tools are compatible with the server versions:
clonit targets verify mydbThis checks connectivity, detects local tool versions (pg_dump, pg_restore, psql), queries server versions, and reports any compatibility issues.
Step 4: Build a Snapshot
Section titled “Step 4: Build a Snapshot”Build a snapshot of the source database:
clonit build mydbThis runs pg_dump in directory format against the source URL and stores the snapshot in the working directory (~/.clonit by default).
Step 5: Load a Snapshot
Section titled “Step 5: Load a Snapshot”Load the most recent snapshot into the destination database:
clonit load mydbLoad a specific snapshot by index:
clonit load mydb 0Load a raw SQL file directly:
clonit load mydb /path/to/file.sqlStep 6: List Targets and Snapshots
Section titled “Step 6: List Targets and Snapshots”View all configured targets:
clonit targetsView snapshots for a specific target:
clonit snapshots mydbStep 7: Start the Web UI (Optional)
Section titled “Step 7: Start the Web UI (Optional)”Launch the web UI for a visual interface to manage targets, snapshots, analysis, and cloud features:
clonit serveOpen http://127.0.0.1:8484 in your browser. The web UI provides:
- Dashboard with stats and recent snapshots
- Target management with connection verification and tool compatibility checks
- Snapshot management with push-to-cloud capability
- AI-powered sanitization analysis (requires Anthropic API key)
- Ephemeral sanitization testing in Docker containers
- Cloud integration for team collaboration
See the serve command for details.
Next Steps
Section titled “Next Steps”- Configuration – customize logging, parallelism, Docker images, cloud connection, and more
- Command Reference – full documentation for every CLI command
- Sanitization Guide – learn how to strip sensitive data from snapshots
- Sanitization Analysis – AI-powered PII detection and query generation
- Cloud Storage Guide – push and pull snapshots with S3 or Cloudflare R2
- Cloud Integration – connect to Clonit Cloud for team collaboration