What You’ll Accomplish
By the end of this guide, you’ll have:- ✅ A
basecut.ymlconfiguration file tailored to your database schema - ✅ A production-realistic snapshot with anonymized PII
- ✅ A restored snapshot in your local development database
- ✅ Understanding of the
init→snapshot create→snapshot restoreworkflow
For production: After completing this guide, see Self-Hosted
Agents for the recommended production deployment.
Prerequisites
- PostgreSQL database (12+) with some data
- Database accessible from your local machine (localhost or network-accessible)
Step 1: Install CLI
Install the Basecut CLI:basecut version x.y.z
Step 2: Authenticate
Create a Basecut account and authenticate:✓ Authenticated as you@example.com
Step 3: Generate Configuration
Point Basecut at your database to auto-detect schema and relationships:init does automatically:
The init command does the heavy lifting for you:
- 🔍 Schema detection: Analyzes all tables, columns, and data types
- 🔗 FK analysis: Maps foreign key relationships to build the dependency graph
- 🎯 Root table suggestions: Identifies good starting points (tables with many incoming FKs)
- 🔄 Cycle detection: Finds and handles circular relationships
- 🛡️ PII detection: Auto-detects common PII patterns (emails, phones, names, etc.)
- 📝 Config generation: Creates a ready-to-use
basecut.ymlwith sensible defaults
basecut.yml in your current directory with:
- Detected tables and foreign key relationships
- Suggested root tables and FK connectivity details
- Optional PII anonymization rules (email, phone, etc.)
✓ Created basecut.yml with 42 tables detected
Example generated basecut.yml
Example generated basecut.yml
Step 4: Create a Snapshot (Local Execution)
Run the extraction locally (default):- CLI reads your
basecut.ymlconfiguration - Connects directly to your database from your machine
- Follows foreign keys from root tables to extract related data
- Applies anonymization rules to PII fields
- Stores snapshot on your local filesystem
Step 5: Restore the Snapshot
Apply the extracted data to a different database (or the same one for testing):- CLI reads snapshot from storage
- Validates target schema compatibility
- Inserts data in dependency order (respects foreign keys)
- Reports completion
Run migrations first. Restore does not create or alter tables.
Your local database now has a production-realistic subset with all PII safely
anonymized.
Common Next Steps
Now that you’ve created your first snapshot, here’s what to explore next:Customize Snapshot Rules
Add domain-specific PII protection rules and fine-tune anonymization
strategies
Set Up CI/CD
Automate snapshot creation and restore in your CI pipeline for consistent
test data
Deploy Agents for Production
Run snapshot extraction inside your VPC for production databases (TEAM plan)
Explore Workflows
Learn patterns for debugging, testing migrations, and sharing data with
partners
Verify the Data
Check what was restored:Ready for Production?
You just completed a local execution quick start. For production workloads, deploy self-hosted agents:Deploy on Railway
One-click managed deployment for a production-ready Basecut agent
Deploy Self-Hosted Agents
Next step for production: Deploy agents in Docker/Kubernetes
(recommended)
Execution Modes
Understand agent vs local execution and when to use each