Upgrading Avalon 8.1 to Avalon 8.2
Requirements
Ruby 4.x and Node.js 24.x are recommended.
Config changes
New defaults
Derivative download will attempt to use presigned urls for S3 urls (
derivative.use_presigned_url)
Changed defaults
managerandgroup_managerhave been removed fromsystem_groupsin the defaultsettings.ymlas they are no longer used with the new inherited permissions. If you have customized this setting you can safely remove these two groups.The blacklight pagination window (
search_pagination) has been configured to display 2 pages on either side of the current page and the first two pages. The final two pages are no longer displayed to dissuade users and bots from doing deep pagination which is a more expensive operation.
Optional
Avalon 8.2 has a feature to require accessibility compliance (transcript or captions present) for items created after a certain date (
accessibility_compliance.compliance_date). This feature is disabled by default (accessibility_compliance.enforce).The HLS streaming nginx container image now has the ability to connect to an authenticated S3 bucket. See https://github.com/avalonmediasystem/avalon-docker#authenticating-and-streaming-from-s3s3-like-storage for more details about configuring this feature.
Unit Migration
With Avalon 8.2 units are now first-class objects instead of just a controlled vocabulary. Permissions and roles are now inherited from units to collections to items. Avalon 8.2 comes with an upgrade migration to create unit objects and set a default unit admin. After the migration completes you can assign a unit admin manually to each individual unit.
Saved Searches in Blacklight Disabled
By default Blacklight has been saving all searches in the database and not automatically cleaning them. Avalon does not make use of these and does not show Blacklight’s interface for saved searches so Avalon 8.2 disables saving these in the database. If you want to clear out the existing saved searches to save on DB space run the following:
RAILS_ENV=production bundle exec rails r 'ActiveRecord::Base.connection.truncate(Search.table_name)'Upgrade Steps
For Manual Installations
Install ruby 4.x (if needed)
Update gems, and migrate DB
bundle install --with production --without development test RAILS_ENV=production bundle exec rake db:migrateInstall node.js 24.x (if needed)
Set
NODE_ENVenvironment variable toproductionUpdate JS dependencies
yarn install # in Avalon root dirRebuild assets
RAILS_ENV=production bundle exec rake assets:clobber assets:precompileUpdate configuration, see Config changes above
Setup DB encryption environment variables
Run the following:RAILS_ENV=production bundle exec rails db:encryption:initThen copy the output to create the
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY,ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY, andACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALTenvironment variables or editconfig/application.rband insert them there. These are secrets so do not commit them to version control.Restart passenger (if using)
passenger-config restart-appRun unit migration
RAILS_ENV=production bundle exec rake avalon:migrate:admin_unitsMigrate existing API tokens
RAILS_ENV=production ACTIVE_RECORD_ENCRYPTION_MIGRATION=true bundle exec rails r 'ApiToken.all.each(&:encrypt)'
For Docker Installations
Stop Avalon
docker compose downUpdate new code from avalon-docker
git fetch git checkout v8.2.0.1 git pullPull new images
docker-compose pull avalonCheck config changes then restart the Avalon containers
docker compose upRun unit migration
docker-compose exec avalon /bin/bash -c "RAILS_ENV=production bundle exec rake avalon:migrate:admin_units"Setup DB encryption environment variables
Run the following and copy the output intoACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY,ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY, andACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALTin.envor editdocker-compose.ymland insert them there in theavalonservice. These are secrets so do not commit them to version control.RAILS_ENV=production bundle exec rails db:encryption:initRestart the application
docker compose down docker compose upMigrate existing API tokens
docker-compose exec avalon /bin/bash -c "RAILS_ENV=production ACTIVE_RECORD_ENCRYPTION_MIGRATION=true bundle exec rails r 'ApiToken.all.each(&:encrypt)'"
You can also build your own image, Docker Buildkit is recommended
docker-compose build avalon
For Terraform installations
Set
avalon_docker_code_branchandavalon_branchinterraform.tfvarsif necessary. (Latest tags arev8.2.0.1for Avalon andavalon-8.2.0.1-aws_minfor avalon-docker.)Perform the upgrade:
terraform applyEnter the EC2 box and run the unit migration and migrate the existing API tokens
sudo su - ec2-user cd avalon-docker docker-compose exec avalon /bin/bash -c "RAILS_ENV=production bundle exec rake avalon:migrate:admin_units" docker-compose exec avalon /bin/bash -c "RAILS_ENV=production ACTIVE_RECORD_ENCRYPTION_MIGRATION=true bundle exec rails r 'ApiToken.all.each(&:encrypt)'"
You may also see an error when attempting to create an iam user which already exists. If this happens rerunning the terraform apply should resolve the issue and successfully run to completion