molt-fetch
Guide for using molt fetch to migrate data from PostgreSQL, MySQL, Oracle, or MSSQL to CockroachDB. Use when running molt fetch commands, configuring storage backends, handling fetch failures/resumption, or chaining fetch with verify.
What this skill does
# molt fetch Bulk data migration from source databases (PostgreSQL, MySQL, Oracle, MSSQL) to CockroachDB. ## Basic Structure ```bash molt fetch \ --source "<source-conn>" \ --target "<crdb-conn>" \ --bucket-path "s3://bucket/prefix" # or --direct-copy or --local-path [options] ``` ## Storage Backends (pick one) | Option | When to use | |--------|-------------| | `--bucket-path "s3://..."` | AWS S3 (also `gs://` for GCS, `azure://` for Azure) | | `--direct-copy` | No intermediate storage; fastest for accessible networks | | `--local-path "/tmp/molt"` + `--local-path-listen-addr "0.0.0.0:9005"` | CRDB must reach the listen addr | Cloud auth: pass `--use-implicit-auth` for IAM/ADC/managed identity, or set `AWS_ACCESS_KEY_ID`/`GOOGLE_APPLICATION_CREDENTIALS` env vars. ## Table Handling (`--table-handling`) | Value | Behavior | |-------|----------| | `none` (default) | Append to existing tables | | `drop-on-target-and-recreate` | Drop + recreate from source schema; enables auto schema creation | | `truncate-if-exists` | Truncate before loading; errors if table missing | ## Import Mode **IMPORT INTO** (default): Table goes OFFLINE during load. Highest throughput. **COPY FROM** (`--use-copy`): Table stays ONLINE. Use with `--direct-copy`. Cannot use compression. ```bash # Zero-downtime load molt fetch --source "..." --target "..." --direct-copy --use-copy ``` ## Key Flags ```bash # Filtering --table-filter "customers|orders" # POSIX regex for tables to include --table-exclusion-filter "temp_.*" # exclude pattern --schema-filter "public" # PostgreSQL only # Performance --table-concurrency 4 # parallel tables (default: 4) --export-concurrency 4 # export threads (default: 4) --row-batch-size 100000 # rows per SELECT (default: 100k) # Schema --type-map-file "types.json" # custom type mappings --transformations-file "transforms.json" # column exclusions, table aliases # Logging --log-file "migration.log" # or "stdout" --logging debug # info (default), debug, trace --metrics-listen-addr "0.0.0.0:3030" # Prometheus scrape endpoint ``` ## Source-Specific Prerequisites **MySQL**: GTID mode required (`gtid_mode=ON`, `enforce_gtid_consistency=ON`). `ONLY_FULL_GROUP_BY` must be off. Or use `--ignore-replication-check`. **Oracle**: Binary must be built with `CGO_ENABLED=1 -tags="cgo source_all"`. Oracle Instant Client in `LD_LIBRARY_PATH`. **PostgreSQL**: Replication privileges needed, or `--ignore-replication-check`. ## Common Workflows ### 1. Full migration with schema creation ```bash molt fetch \ --source "postgresql://user:pass@pg:5432/db" \ --target "postgresql://root@crdb:26257/db" \ --bucket-path "s3://mybucket/migration" \ --table-handling drop-on-target-and-recreate \ --table-filter "customers|orders|payments" \ --log-file migration.log ``` ### 2. Resume after failure ```bash # List available continuation tokens molt fetch tokens --fetch-id "abc-123" --target "postgresql://root@crdb:26257/db" # Resume all failed tables molt fetch \ --source "..." --target "..." \ --bucket-path "s3://mybucket/migration" \ --fetch-id "abc-123" \ --non-interactive ``` ## Error Recovery | Error | Cause | Fix | |-------|-------|-----| | "GTID-based replication not enabled" | MySQL missing GTID | Enable `gtid_mode=ON` or add `--ignore-replication-check` | | "Column mismatch" | Schema diverged | Fix target schema manually or use `--type-map-file` | | Silent IMPORT INTO | CockroachDB import running | `SHOW JOBS` on CRDB to check progress | | "timestamp in the future" | Docker/Mac clock drift | Sync clocks between hosts | ## Gotchas - COPY mode: cannot use `--compression gzip`; must use `--compression none` (or omit, default is none with copy) - Table is **offline** during IMPORT INTO — use `--use-copy` for zero downtime - Schema changes between runs require starting from scratch - `--fetch-id` continuation tokens live in the target's exceptions table - For MySQL, `--ignore-replication-check` skips GTID validation but replication-dependent features won't work - After fetch, run `molt verify` to confirm data integrity See [flags reference](references/flags.md) for the full flag list.
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.