# MIGRATION PLAN — Zoho Books → PURE Money (V8 item 5 · authored 7/11/26)
**Owner:** Mike schedules · Code owns import RPCs · depends on Stripe rails (v9) for forward billing.
**Rule:** plan now, EXECUTE in v9.

## Live target schema (probed 7/11)
- `pure_invoices`: id, bill_to, org_level, memo, amount, issued_on, due_on, paid, paid_at, is_demo, created_at, deal_id, vendor_email
- `pure_expenses`: id, member_email, org_id, context, context_ref, category, merchant, amount, expense_date, miles, mileage_rate, receipt_photo, memo, reimbursable, status, approver, decided_at, reimbursed_at, created_at
- `pure_earnings`: (table absent)

## Map (Zoho export → PURE)
| Zoho | PURE | Note |
|---|---|---|
| Invoices.csv | pure_invoices | number→memo prefix "ZB-"; status paid/open map |
| Expenses.csv | pure_expenses | category map table below |
| Customers.csv | pure_contacts (billing flag) | dedupe on email |
| Chart of Accounts | category column values | keep Zoho names v1 |
| Payments | pure_invoices.paid_at | latest payment date |

Category map: Advertising→marketing · Meals→meals · Software→software · Commissions Paid→commission · everything else→other (review list in dry run).

## Cutover checklist
1. Zoho → Reports → export FY24-FY26 CSVs — Mike.
2. Dry run via Data Onboard; totals must tie to Zoho P&L within $1.
3. Freeze → final export → import → verify month-by-month rollups on pure-earnings.
4. Zoho read-only through tax season; cancel after CPA sign-off (Patel return cycle).

## Rollback
`import_batch` tag per run; delete clears. Zoho untouched until cancel.
