Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This page is a work in progress.

Requirements

Ruby 3.2.x and Node.js 20.x are recommended.

...

If the migration reports that the migration was successful but the counts do not match, it could be that parent objects have been deleted orphaning SupplementalFiles, a known problem.

MediaObject Section List Migration

...

Avalon 7.8 moves data about section order from a separate fedora object to a property on the MediaObject model to be more performant when objects have many sections. The MediaObject model is already coded to lazily migrate existing objects whenever they are saved and this migration will finish updating objects that haven’t already been migrated.

...

Code Block
RAILS_ENV=production bundle exec rails r "ActiveFedora::SolrService.instance.conn.get('select', params: { rows: 1_000_000, q: 'has_model_ssim:MediaObject', fl: [:id, :section_list_ssim], sort: 'id asc' })['response']['docs'].each {|doc| puts \"#{doc['id']}: section_ids: #{JSON.parse(doc['section_list_ssim'].first || '[]').to_s}\" }" > log/section_list_dump.post_migration.txt
diff -awu log/section_list_dump.pre_migration.txt log/section_list_dump.post_migration.txt
Note

Note that while the migration is running there will be duplicate values in the format facet in search results. The indexed value of the format changed in 7.8 so both will appear until all items have been migrated.

Upgrade Steps

For Manual Installations

  1. Install ruby 3.2.x (if needed)

  2. Update gems, and migrate DB

    Code Block
    bundle install --with production --without development test 
    RAILS_ENV=production bundle exec rake db:migrate
  3. Install node.js 20.x (if needed)

  4. Update JS dependencies

    Code Block
    yarn install # in Avalon root dir
  5. Update configuration, see Config changes above

  6. Restart passenger (if using)

    Code Block
    passenger-config restart-app
  7. Run rake migrations

    Code Block
    RAILS_ENV=production bundle exec rake avalon:migrate:backfill_parent_id
    RAILS_ENV=production bundle exec rake avalon:migrate:media_object_section_list

For Docker Installations

Warning

Before upgrading an AWS docker install based on avalon-terraform or the aws_min branch of avalon-docker make a backup of your supplemental files prior to destroying the avalon container!

Code Block
docker cp avalon-docker-aws_min_avalon_1:/home/app/avalon/storage ./active_storage_backup

Then load them into an S3 bucket:

Code Block
aws s3 cp active_storage_backup/* s3://${SETTINGS__ACTIVE_STORAGE__BUCKET}/ --recursive 

See https://github.com/avalonmediasystem/avalon-docker/issues/77 for more discussion on this. If you run into any problems, please reach out on slack or the email list.

  1. Stop Avalon

    Code Block
    docker-compose down
  2. Update new code from avalon-docker

    Code Block
    git checkout main
    git pull
  3. Pull new images

    Code Block
    docker-compose pull avalon solr
  4. Check config changes then restart the Avalon containers

    Code Block
    docker-compose up
  5. Run rake migrations (inside avalon container)

    Code Block
    RAILS_ENV=production bundle exec rake avalon:migrate:backfill_parent_id
    RAILS_ENV=production bundle exec rake avalon:migrate:media_object_section_list

...