# Upgrade Hyperchat 1.9 to 1.10

Back up source, the database and private configuration. Extract the new version separately and merge the changes into your customized installation; do not run fresh-install setup over it. Read the intermediate upgrade guides if upgrading from an older release.

This update adds **Ads → Video batches** for weekly Meta/TikTok uploads and per-ad KPI controls. Nothing is enabled for an existing account. Read [the workflow and limitations](video-ad-batches.md) before approving a batch.

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

## Merge map

- Add `convex/videoAdModel.ts`, `videoAds.ts`, `videoAdWorkers.ts` and the new table spread in `schema.ts`. Keep every existing table/index. `socialModel.ts` adds an optional `videoBatchId`; old jobs remain valid.
- Add the scheduler in `convex/crons.ts`. Preserve other crons and their schedules.
- Merge the optional media ID return from `socialMedia:register` and provider error metadata from `socialProvider.ts`. Existing call contracts remain valid.
- Preserve the manual-hold integration and batch-dispatch guard in `convex/social.ts`. Ordinary campaign controls must not launch a batch's approval record as a standalone ad.
- Add `src/lib/video-ad-batches.ts`, the batch UI and stylesheet, the Ads tab, reviewer preview and `/demo/video-ads`. Preserve your navigation and styling customizations.
- Add `tests/video-ads.spec.ts`. Run typecheck, unit/backend tests and a clean production build before enabling the worker in your installation.

Deploy the schema and functions to **your Hyperchat backend first**, then the matching frontend. Do not deploy them to a DevLaunch website backend. No new provider keys are required; eligible advertising connections and metrics are required. Review your storage/provider usage for a 100-file batch.

Create a draft in an isolated test workspace. Verify the complete review screen, Meta/TikTok payloads, currency and settings before approving any spending. Fixture tests and the demo do not substitute for acceptance on your own account.

To roll back, pause active batches and confirm the native campaigns are paused before removing the new worker/frontend. Keep the additive tables, original files, provider resources and activity records. Removing a cron does not pause an already-running native campaign.
