twenty-migrate-pipedrive
v1.0.0
Published
CLI migration tool for Pipedrive to Twenty CRM
Maintainers
Readme
Twenty Pipedrive Migration Tool
CLI migration tool for Pipedrive to Twenty CRM.
Installation
npm install -g twenty-migrate-pipedriveUsage
Basic Migration
twenty-migrate-pipedrive \
--source-token YOUR_PIPEDRIVE_API_TOKEN \
--twenty-url http://localhost:3000 \
--twenty-key YOUR_TWENTY_API_KEYDry Run (Preview)
twenty-migrate-pipedrive \
--source-token YOUR_PIPEDRIVE_API_TOKEN \
--twenty-url http://localhost:3000 \
--twenty-key YOUR_TWENTY_API_KEY \
--dry-runSelect Objects
twenty-migrate-pipedrive \
--source-token YOUR_PIPEDRIVE_API_TOKEN \
--twenty-url http://localhost:3000 \
--twenty-key YOUR_TWENTY_API_KEY \
--objects persons,organizationsFeatures
- Pipedrive API Integration - REST API v1 for data extraction
- Paginated Extraction - Handle large datasets efficiently
- Schema Mapping - Pipedrive → Twenty CRM field mapping
- Batch Processing - Process records in configurable batches
- Progress Tracking - Real-time migration progress
- Dry Run Mode - Preview migration without changes
- Error Handling - Detailed error logging and recovery
- Duplicate Prevention - Check for existing records
Migration Mapping
| Pipedrive | Twenty | |-----------|--------| | persons → name, email, phone | people → name, email, phone | | organizations → name | companies → name | | deals → title, value, currency, status | opportunities → name, amount, stage | | activities → subject, note, type | activities → subject, note, type | | notes → content, person_id, org_id | notes → body, person/company links |
What Migrates
✅ Supported Objects:
- Persons → People (name, email, phone, organization)
- Organizations → Companies (name, address)
- Deals → Opportunities (title, value, currency, status)
- Activities → Activities (subject, note, type)
- Notes → Notes (content, associations to persons/organizations/deals)
❌ What Doesn't Migrate:
- Custom fields
- File attachments
- Activity history and logs
- Pipeline stages (mapped to status)
- Currency conversion (stored as pipeline)
- Users and owners
- Webhooks and integrations
Command Line Options
Options:
-s, --source-token <token> Pipedrive API token (required)
-u, --twenty-url <url> Twenty CRM URL (required)
-t, --twenty-key <key> Twenty CRM API key (required)
-d, --dry-run Preview migration without writing data
-o, --objects <objects> Objects to migrate (comma-separated)
-b, --batch <number> Batch size for API calls (default: 60)
-h, --help Show help
-v, --version Show versionEnvironment Variables
Create a .env file:
# Pipedrive API Configuration
PIPEDRIVE_API_TOKEN=your_pipedrive_api_token_here
PIPEDRIVE_API_URL=https://api.pipedrive.com/api/v1
# Twenty CRM Configuration
TWENTY_URL=http://localhost:3000
TWENTY_API_KEY=your_twenty_api_key_here
# Migration Settings
BATCH_SIZE=60
RATE_LIMIT_DELAY=600
DRY_RUN=false
OBJECTS=persons,organizations,deals,activities,notesRate Limiting
- Pipedrive API: 100 requests per minute
- Automatic delay: 600ms between requests
- Batch processing: 60 records per batch
- Retry mechanism: Automatic retry on failures
Reports
Migration Report
{
"timestamp": "2026-04-04T14:30:00.000Z",
"migration": {
"tool": "twenty-migrate-pipedrive",
"version": "1.0.0",
"objects": ["persons", "organizations", "deals", "activities", "notes"],
"dryRun": false
},
"summary": {
"total": 1000,
"success": 985,
"errors": 15,
"successRate": "98.50%"
},
"objectResults": {
"people": {
"attempted": 500,
"success": 495,
"errors": 5,
"successRate": "99.00%"
},
"companies": {
"attempted": 200,
"success": 198,
"errors": 2,
"successRate": "99.00%"
},
"opportunities": {
"attempted": 150,
"success": 147,
"errors": 3,
"successRate": "98.00%"
},
"activities": {
"attempted": 100,
"success": 97,
"errors": 3,
"successRate": "97.00%"
},
"notes": {
"attempted": 50,
"success": 48,
"errors": 2,
"successRate": "96.00%"
}
},
"errors": [],
"recommendations": []
}Error Log
Batch 1 (people): Duplicate email detected - [email protected]
Batch 2 (companies): Invalid organization format - "Tech & IT"
Batch 3 (opportunities): Invalid amount format - "$50,000"Examples
Large Dataset Migration
twenty-migrate-pipedrive \
--source-token 1234567890abcdef \
--twenty-url https://your-company.twenty.com \
--twenty-key twenty_api_key_1234567890 \
--batch 30 \
--objects persons,organizations,dealsTest Migration
twenty-migrate-pipedrive \
--source-token 1234567890abcdef \
--twenty-url http://localhost:3000 \
--twenty-key twenty_api_key_1234567890 \
--dry-run \
--objects personsPipedrive API Token Setup
- Login to Pipedrive
- Go to Settings → Personal Preferences → API
- Generate API Token
- Copy the token and use it in the migration
Development
# Clone repository
git clone https://github.com/deliveredbyai/twenty-migrate-pipedrive.git
cd twenty-migrate-pipedrive
# Install dependencies
npm install
# Build project
npm run build
# Run tests
npm test
# Start development
npm run devContributing
- Fork the repository
- Create feature branch
- Make your changes
- Run tests
- Submit pull request
License
MIT License - see LICENSE file for details.
Troubleshooting
Common Issues
"Pipedrive API connection failed"
- Check API token validity
- Verify Pipedrive account permissions
- Ensure API token has proper scopes
"Rate limit exceeded"
- Increase batch size delay
- Reduce concurrent requests
- Check Pipedrive API limits
"Duplicate records"
- Tool automatically prevents duplicates
- Check existing data in Twenty CRM
- Use dry-run to preview duplicates
"Invalid field mapping"
- Review field mapping table
- Check Pipedrive field names
- Verify Twenty CRM field requirements
Support
Acknowledgments
- Pipedrive API - REST API documentation
- Twenty CRM - Open-source CRM
- Commander.js - CLI framework
- CLI Progress - Progress bars
