Roster Wizard Production Upgrade

How to Upgrade a Production Installation of Roster Wizard

Backup database:

cd /opt/roster
docker compose exec db pg_dumpall -U postgres > roster.sql

Update .env files if there are new variables since previous installation (see production installation instructions for details).

rm docker-compose.yml
rm docker-compose.override.yml
rm docker-compose.production.yml
wget https://raw.githubusercontent.com/galojix/roster-wizard/master/docker-compose.yml
wget https://raw.githubusercontent.com/galojix/roster-wizard/master/docker-compose.production.yml
cp docker-compose.production.yml docker-compose.override.yml
docker compose down
docker compose pull
docker compose up -d
docker compose exec web python manage.py migrate
docker compose exec web python manage.py collectstatic
docker image prune

Check the Roster Wizard User Guide for changes.

You may see the following error during the upgrade if your original installation was prior to 2024:

WARNING: database "postgres" has a collation version mismatch 
DETAIL: The database was created using collation version 2.31, but the operating system provides version 2.36. 
HINT: Rebuild all objects in this database that use the default collation and 
run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.

The fix for this problem is as follows:

docker compose up -d
docker compose exec db bash
psql -U postgres

\c postgres;
reindex database postgres;
ALTER DATABASE postgres REFRESH COLLATION VERSION;

\c template1;
reindex database template1;
ALTER DATABASE template1 REFRESH COLLATION VERSION;

\q

exit