Files
using.cash/openspec
rick 51f40a5443
CI / docker (push) Has been cancelled
CI / build-and-test (push) Has been cancelled
Add data migration tool — verified against production data (section 8)
Full ETL migration from v5 Swarmops MySQL to v6 UsingCash schema.
Tested against a real production mysqldump (sha256: 735ba82d...06850e).

Migration results (all verified):
- 246 currencies, 2 organizations (with OOD denormalization)
- 4 users (from People), 147 financial accounts
- 4,010 transactions, 8,590 rows (67 with foreign currency)
- 1,227 dependencies (28 continuation chains preserved)
- 292 expense claims, 283 inbound invoices (with OOD), 101 outbound
- 422 payouts, 98 payment groups, 98 payments
- 2,863 documents, 3,570 exchange rate snapshots + 614,750 datapoints
- 36 hot wallet addresses + 44 UTXOs, 12 dep types, 21 settings

Verification passed on all three levels:
- Transaction row totals per org/year: exact match
- Per-account balance totals (100 accounts): exact match
- Record counts for all major tables: exact match

Key implementation details:
- Reads v5 ObjectTypes + ObjectOptionalDataTypes lookup tables to
  map EAV data by name (not hardcoded IDs)
- Denormalizes OOD into first-class v6 columns for orgs, accounts,
  invoices, transactions
- ClosedThroughYear: uses v5 OrgBooksClosedForYear when present,
  fallbacks only if missing
- OrgOpenLedgersDomain and OrgVanityDomain preserved (schema updated)
- Batched INSERT for exchange rate datapoints (614K rows in ~4 min)
- Handles MySQL zero-datetime values gracefully
- Triggers must be disabled during migration (historical data loading)
  then re-enabled after

Made-with: Cursor
2026-04-08 18:16:30 +02:00
..