Upgrading

A new release, its migrations, and rebuilding indexes.

cd /opt/pinax && sudo git fetch --tags && sudo git checkout vX.Y.Z && sudo env UV_PYTHON_INSTALL_DIR=/opt/pinax/.python uv sync --frozen --no-dev
sudo systemctl restart pinax-web pinax-ingest
pinax rebuild --outdated

CHANGELOG.md says when a release changes the index format (INDEX_VERSION). Older indexes still answer, but without what the new format adds, so pinax rebuild --outdated builds them again from their scans, oldest first (each one is compared with the snapshot before it), in place: each snapshot stays available on its old index until the new one replaces it, and keeps it if the build fails. When the file categories change, it also builds again the indexes built with the old ones (with --latest, only each filesystem's latest). The web app opens rebuilt indexes without a restart. pinax rebuild SNAPSHOT_ID rebuilds one, for example one whose index was lost. Rebuilding needs the snapshot's scan: a snapshot whose scan folder was deleted keeps its old index, without what the new format adds, and the rebuild says so.

The catalog is upgraded by migrations, when the web app or the watcher starts: CHANGELOG.md says when a release has one, and journalctl -u pinax-web shows Upgraded the catalog to revision .... Back the catalog up first (Backups). Processes that start together take turns, and a catalog from 0.9.0 or earlier (made before migrations) is adopted the same way. Where database changes go through a database administrator, set PINAX_DB_AUTO_UPGRADE=false: Pinax then refuses to start with a catalog that is behind and says so, and

pinax db upgrade --sql

prints the SQL to review and apply, or pinax db upgrade applies it. A catalog that a newer release has upgraded is refused by an older one: to go back to an older release, restore a backup made before the upgrade.