Updates.
A new version, safely.
A new version can add columns and tables to the database. npm run upgrade-check does this safely: it backs up first, applies every change in one transaction, and records the new version in the database. Older code never runs on a newer database: the server refuses to start with a message that says which version to install.
01Plain Node.js
On Windows: the server is meant to run on Linux. On a Windows PC, run the commands on this page inside WSL 2 with Ubuntu (in PowerShell: wsl --install -d Ubuntu), or use Docker Desktop with its WSL 2 backend.
cd /opt/channelsmith
sudo systemctl stop channelsmith
npm run backup # an extra copy, just in case
# replace the files with the new version (keep .env and the data folder), then:
npm ci
npm run build
npm run upgrade-check -- --dry-run # shows what would change, changes nothing
npm run upgrade-check # backs up, then applies it
sudo systemctl start channelsmith
02Docker
docker build -t channelsmith:new .
docker stop channelsmith
docker run --rm --env-file .env -v channelsmith-data:/app/data channelsmith:new npm run upgrade-check
docker rm channelsmith
docker tag channelsmith:new channelsmith
docker run -d --name channelsmith --restart unless-stopped -p 127.0.0.1:8787:8787 --env-file .env \
-v channelsmith-data:/app/data channelsmith
03What upgrade-check answers
| Answer | Meaning |
|---|---|
| No database yet | A new install. Start the server. |
| Up to date | The code and the database have the same version. |
| Updated the database from X to Y | Changes applied, the backup taken first is named. Start the server. |
| Stop: the database was last used by Channelsmith X | You installed an older version than the one that last used the data. Install X or newer, or restore a backup made with this version. Exit code 1. |
If anything fails while applying, the transaction is rolled back and the database stays exactly as it was.
The server records its version in the database every time it starts, and the console's System health page shows the app version and the database's schema version. Starting a new version without running upgrade-check also works (the server adds missing columns and tables on start), but without the backup first.