Skip to content

Upgrade and Rollback ​

Upgrade the backend and frontend together. Database migrations run at startup and are not reversible, so a pre-upgrade snapshot is your rollback boundary.

Before Upgrading ​

  1. Read every release note between the current and target versions.
  2. Confirm the target image tag exists for both rust-srec and rust-srec-frontend.
  3. Download a configuration export and take a consistent backup of the database, configuration, output, .env, and Compose file.
  4. Record the current image tags or digests and the result of health checks.
  5. Schedule around active recordings and pipeline jobs. An interrupted media write may need manual inspection.

Docker Upgrade ​

Edit .env so VERSION is the reviewed target, for example:

dotenv
VERSION=v0.8.0

Then run:

bash
docker compose pull
docker compose up -d
docker compose ps
docker compose logs --tail=200 rust-srec
curl http://localhost:12555/api/health/live

After signing in, verify authenticated readiness, the System Health page, streamer count, recent sessions, one platform check, and a noncritical recording/pipeline. Keep the pre-upgrade backup until the observation period ends.

systemd Upgrade ​

Swap the binary in place and restart the unit. install replaces the file rather than writing into it, so the running process is unaffected until the restart:

bash
install -D -m 0755 rust-srec /opt/rust-srec/rust-srec
systemctl restart rust-srec
systemctl status rust-srec
journalctl -u rust-srec --since "5 min ago"
curl http://localhost:12555/api/health/live

Reinstall rust-srec.service to /etc/systemd/system/ and run systemctl daemon-reload only when the release changes the unit itself; a release note says so when it does. Then repeat the same post-upgrade checks as the Docker path.

Automatic Updates (Watchtower) ​

Watchtower is part of the Docker deployment and does not apply to the systemd service, which is upgraded by hand as above.

The Compose file ships an optional watchtower service that pulls new images and recreates the containers automatically. It is off by default; enable it with:

bash
docker compose --profile autoupdate up -d

Updates only happen while the system is idle. Before stopping a container, Watchtower runs its pre-update hook, which calls the unauthenticated GET /api/health/idle endpoint:

  • 200 — nothing is recording or queued to record, and no pipeline job (upload, remux, danmaku conversion, ...) is processing. The update proceeds.
  • 503 or no response — the hook exits with code 75 and Watchtower skips this cycle, retrying on the next poll (WATCHTOWER_POLL_INTERVAL, default 3600 seconds).

Pending pipeline jobs do not block an update; they are persisted and re-run after the restart. The frontend container carries the same gate, so both images move to the new version in the same cycle.

Caveats:

  • Automatic updates require a mutable image tag: keep VERSION=latest (or dev). Pinned vX.Y.Z tags never receive updates.
  • Database migrations still run at startup and are not reversible. Automatic updates skip the manual pre-upgrade snapshot, so keep scheduled backups (see Backup and Restore) and read release notes regularly. If an upgrade must be reviewed before rollout, stay on manual upgrades with a pinned tag.
  • The idle check runs immediately before the container stops; a recording that starts in the few seconds in between is still interrupted.

Historical SQLite Migration Notes ​

Preset/template timestamps (20260907120000) and filter timezones (20260909120000)

Preset and Template Timestamps ​

Migration 20260907120000 normalizes created_at and updated_at in job_presets, pipeline_presets, and template_config to integer Unix milliseconds. Existing integers are preserved; historical date strings are converted with their timezone (truncating submillisecond precision), and API dates remain strings.

If startup reports Cannot normalize preset/template timestamps, one of these columns contains an invalid or unsupported historical value, such as an expanded-year date produced by an older timestamp decoding error. The migration rolls back and preserves the original values. Stop the backend, retain a database backup, inspect those six columns, and repair only values whose intended time can be established from the backup or other records. Restart to retry the migration. Do not replace unknown dates with the current time or edit a shipped migration.

Filter Timezone Compatibility ​

Migration 20260909120000 preserves existing TimeBased schedules by writing "timezone":"local" where an object configuration omitted timezone or used null, while leaving explicit zones, Cron rules, row identities, unrelated fields, and malformed JSON untouched.

Backup exports write explicit filter timezones using schema 0.1.8, or 1.0.0 when account profiles, credential selections, or saved proxies are present. For current filter timezone rules and older-backup import behavior, see filter timezones and boundaries.

Account credentials ​

Versions before v0.6.0 stored cookies, tokens and logins (Twitch OAuth token, Douyin TTWID, Douyu device ID, SOOP username and password) directly in platform, template and streamer configuration. The first start of v0.6.0 or later converts them into account profiles:

  • Each platform, template or streamer that carried its own credentials gets a profile on its platform, labeled after it with "(migrated)", and a fixed selection of that profile. The profile holds what its recordings used before, including the platform's SOOP login.
  • Identical credentials on one platform share a single profile.
  • A template's cookie is converted only for platforms whose streamers use the template.
  • A cookie on the Streamlink platform, or a template cookie used by Streamlink streamers, becomes a fixed selection on each of those streamers that has no account of its own, because a Streamlink account is never shared by every site. Backups are imported the same way, including a Streamlink platform or template selection; an imported pool there keeps only its first account.
  • Empty cookie fields are treated as unset: that scope inherits.
  • Credentials that are not valid account material are dropped, with a warning in the log.

Take a backup before upgrading; going back to an earlier version needs it. See backup and rollback.

Proxy settings ​

Versions before v0.6.0 stored a proxy address and login in global, platform, template and streamer settings. The first start of v0.6.0 or later converts them into saved proxies under Settings → Proxies and points each setting at its proxy. Take the pre-upgrade backup first: the conversion clears the old settings, and an earlier version cannot read the new ones. Check that the proxy environment variables the backend should see are set before that start.

  • Each distinct address and username becomes a saved proxy named after its host:port, with 2, 3… added when the name is taken, and every setting that used it chooses it. A login written into the address moves into the username and password fields, and an address without a scheme gets http://. Settings with the same address and username share one proxy; when their passwords differ, the first one found is kept.
  • Use System Proxy becomes System proxy. On a platform, template or streamer, a proxy that was turned off becomes Direct, and no proxy setting becomes Inherit.
  • An address no engine can use, such as socks4, becomes Direct, with a warning in the log.
  • A global proxy that was turned off or empty becomes System proxy when HTTP_PROXY, HTTPS_PROXY or ALL_PROXY is set at that start, otherwise Direct. That keeps FFmpeg and Streamlink downloads on the environment's proxy; live checks, Mesio downloads and danmu use it too. Choose Direct afterwards if they should not.

Direct keeps FFmpeg and Streamlink off the environment's proxy, so a platform, template or streamer whose proxy was turned off no longer sends their downloads through it after the upgrade. Choose System proxy there if it should.

After starting, review Settings → Proxies and the Default proxy under Settings → Global → Network & System. Older backups are converted the same way when imported, except for the environment rule; see proxies in backups.

Rollback ​

Do not start an older binary against a database already migrated by a newer release unless the release notes explicitly say it is compatible.

  1. Stop both services.
  2. Restore the pre-upgrade database and configuration snapshot.
  3. Reset VERSION to the previous tag or image digest, or reinstall the previous binary over /opt/rust-srec/rust-srec.
  4. Start both services and repeat the health and recording checks.

Any sessions or configuration created after the snapshot will be lost. If those changes matter, preserve the failed-upgrade data separately for forensic recovery rather than merging it directly into the restored database.

Source or Binary Installations ​

Keep the exact binary, frontend build, environment file, and database snapshot as one release unit. Build with --locked; do not combine an arbitrary frontend commit with a different backend release.

Released under the MIT / Apache-2.0 License.