Data migration scripts to move data from legacy DIR (MySQL) to Modular Monolith (PostgreSQL).
Epic: https://caring.atlassian.net/browse/CARE-1721 Ticket: https://caring.atlassian.net/browse/CARE-1726
- Call History - Legacy Talk contact history
- Notes - Affiliate notes and self-qualified notes
- Install dependencies:
npm install- Configure environment variables:
cp .env.example .env
# Edit .env with your credentials- Always connects via SSH tunnel to production database
- Source:
dir_productiondatabase - Cannot be disabled (production data only)
- Production Mode (
ENABLE_POSTGRES_SSH=true): Connects via SSH tunnel to production - Local Mode (
ENABLE_POSTGRES_SSH=false): Connects directly to local PostgreSQL for testing
ENABLE_POSTGRES_SSH=true
POSTGRES_HOST=canario-db-replica.csokkjcgv0yx.us-east-1.rds.amazonaws.com
POSTGRES_PORT=5432ENABLE_POSTGRES_SSH=false
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DATABASE=modular_monolithSee .env.local.example for a complete local testing configuration.
npm run devnpm run buildnpm startsrc/config/database.ts- Database configurationsrc/db/mysql.ts- MySQL connection with SSH tunnelsrc/db/postgres.ts- PostgreSQL connection (with optional SSH tunnel)src/index.ts- Main entry point