# Upgrade Hyperchat 1.8 to 1.9

Back up your source, database and private configuration. Extract the new release separately and merge by feature, preserving branding, integrations, authentication, roles, provider settings, secrets, published workflows and data. Do not run fresh-install setup on an existing installation. Read intermediate upgrade guides for earlier versions.

This update connects accepted funnel forms to existing sales deals and follow-ups. Routing starts off and requires an administrator to configure each funnel. Existing domains and visit measurement continue to use their saved settings. No contact, deal or task backfill runs.

```sh
node scripts/plan-upgrade.mjs --installed /path/to/current --baseline /path/to/untouched-old-release --incoming /path/to/hyperchat-1.9.0 > upgrade-plan.json
```

## Merge map

- `convex/funnelModel.ts`: optional routing configuration and outcome fields plus the `funnelLeads.by_routing` index. Preserve your custom schema.
- `convex/salesModel.ts`: optional originating funnel/submission IDs on deals and follow-ups. Existing records remain valid.
- `convex/funnelRouting.ts`, `funnelRoutingModel.ts`, and the call in `funnels:submit`: scoped settings, read-only routing validation, create/reuse work, paginated attention queue and administrator retry. Keep the existing lead validation, deduplication, rate limits, contact intake and conversion tracking.
- `src/components/funnel-routing.tsx`, `funnel-tools.tsx`, `funnel-tools.css`, the submission outcome column in `funnel-manager.tsx`, and `src/lib/funnel-tools-api.ts`.
- `tests/funnel-routing.spec.ts` and the updated `tests/integration/funnel-tools-ui.mjs` provide acceptance coverage; the optional browser fixture uses Puppeteer/esbuild, not production dependencies.

Deploy schema/functions to the buyer's own Hyperchat backend before the frontend. Generate the complete Convex API, install locked dependencies, run type checks, unit/backend tests and a production build. Never use the DevLaunch website backend for Hyperchat data.

In a test workspace, choose a pipeline/owner, enable a follow-up and submit synthetic details. Check one deal/task, repeated requests, human edits, a revoked assignee, the review queue and an administrator retry. Verify an in-app reminder without sending customer messages. Read docs/FUNNEL_LEAD_ROUTING.md for rules and limits.

Rollback: turn routing off per funnel, then restore the previous web/backend source as a matched pair while retaining the additive fields/index and customer data. Existing generated sales work remains available for normal manual handling; do not delete it as an upgrade repair.
