Upgrade Guide
How to move an existing Streamix install to a new release safely. Read the Changelog first for what changed.
How updates work
- Updates ship as a full source release. There are no migration files to run: new tables and columns are added by idempotent
ensure*Schema()functions (CREATE TABLE IF NOT EXISTS,ADD COLUMN IF NOT EXISTS) the first time the code touches them. - Settings, credentials, members and catalogue live in the database and are kept.
- Files in the bucket are untouched.
Before you start
- Back up the database (
pg_dumpor a Neon branch) and note your.env. See Backup & Restore. - List your code changes. If you changed core files, keep a diff (
git diffagainst the release you started from) so you can re-apply it. - Try the upgrade on a staging copy first (a Neon branch plus a preview deployment).
Upgrade steps
# 1. Replace the source with the new release (or merge it into your fork)
# 2. Install dependencies
npm install
# 3. Type check and build
npx tsc --noEmit -p tsconfig.json
npm run build
# 4. If you add or customise add-ons, regenerate their indexes
npm run addons:bundle
# 5. Regenerate the API reference if you changed routes
npm run gen:openapi
Then deploy.
Schema changes and DB_SCHEMA_READY
If production runs with DB_SCHEMA_READY=1, the schema functions are skipped, so new columns will not be created. For an upgrade:
- Deploy with
DB_SCHEMA_READYunset (or0). - Open the storefront, admin and a player page once (or run
npm run db:initand a seed script, which provision the schema). - Set
DB_SCHEMA_READY=1again.
Background processes
- Restart the transcode worker with the new code; it releases its current job on SIGTERM and the job is picked up again.
- The cron needs no change unless the release notes say so. Run it once after deploying to refresh Top 10 and recommendations.
New seed data
Releases may add reference data (email templates, row types). Most is inserted lazily when first needed. Where a script is provided, run it; they are idempotent. Example: databases seeded before personalised rows existed can add them with:
npx tsx scripts/seed-recommendation-rows.ts
After upgrading
- Admin loads; Configuration → Add-ons shows storage and payments connected
- A demo member can sign in, choose a profile and play a title
- Checkout works in sandbox
-
curl -H "Authorization: Bearer $CRON_SECRET" https://…/api/v1/cronreturns a summary without errors - Transcode worker is polling (if used)
Rolling back
Redeploy the previous release. Added columns and tables are harmless to older code. If data was changed in a way the old version can't read, restore the backup or switch DATABASE_URL back to the pre-upgrade Neon branch.
Upgrading from the pre-streaming release
Streamix was converted from an earlier audio and video library template. If your database comes from that version:
- Deploy the streaming release and let the schema provision (see above).
- Seed the streaming reference data (the install wizard does this on a fresh install; on an existing database run
npx tsx scripts/seed-ott.tsfor demo content, or create genres, ratings and plans in the admin). - Remove the old tables and menu entries once you have what you need from them:
npx tsx scripts/drop-legacy-tables.ts # dry run: shows what would go
npx tsx scripts/drop-legacy-tables.ts --apply # drop empty legacy tables, remove old menu entries/pages
npx tsx scripts/drop-legacy-tables.ts --apply --force # also drop legacy tables that still hold rows
It targets the old audio/video library tables and their engagement tables (likes, comments, history, watch later, playlists), menu entries and CMS pages for removed routes, and tables from unrelated modules. --apply is destructive; back up first.
Old member URLs keep working through permanent redirects: /favourites and /watch-later → My List, /history → viewing activity, /trending → New & Popular, /videos → Movies, /settings → Account.
© CreativeCape Solutions · creative-cape.com · support@creative-cape.com