Skip to content

Upgrade Hyrax 2.x to Hyrax 3

Thomas Scherz edited this page Jan 26, 2024 · 9 revisions

Here are the steps to upgrade from Hyrax 2.x to Hyrax 3.6

These instructions are based on release notes to hyrax 3.6.

  1. Update Gemfile to specify these gems:
gem ‘bundler' 
gem 'active-fedora’
gem 'hyrax', '3.0.0'
gem 'dry-monads', '1.4.0' 
gem 'puma', '~> 5.6'
gem 'psych', '< 4’
gem “okcomputer"
run bundle update
  1. Run Rails DB Migrations:
rails hyrax:install:migrations
If you have any Solrizer calls in your overwrites or test you will need to replace them with
ActiveFedora::Indexing
  1. Universal Viewer switching to YARN
yarn install or rake assets:precompile
  1. If you use RIIIF you will need to adjust initializer
config/initializers/hyrax.rb
config.iiif_image_url_builder = lambda do |file_id, base_url, size, format|
  1. TinyMCE Config File
Remove link from the call.
  1. Using Diff Checkers and the Hyku left_v_right script : https://raw.githubusercontent.com/scientist-softserv/hyku-tools/main/bin/left_v_right. You can identify which files are only in the application, which files are only in the engine, and which files are in both. https://github.com/scientist-softserv/hyku-tools#reviewing-repositories

  2. View Overwrites In many of our institutions we have view overwrites that make calls to methods that are no longer there.

def create_work_presenter
    Deprecation.warn(self, "The `create_work_presenter` helper is deprecated " \
                           "for removal in Hyrax 3.0. The work selector has " \
                           "been removed the masthead in Hyrax 2.1.")

    Hyrax::SelectTypeListPresenter.new(current_user)
  end

in our toolbar view we pointed to the Hyrax Name Space instead of the ruby method.

i.e.
<% if Hyrax::SelectTypeListPresenter.new(current_user).many? %> INSTEAD OF
<% if create_work_presenter.many? %>
  1. Metadat Views for Multi_Value : The form views and edit_record fields need to be refactored to account for the new multi_value syntax. Multi-value should be moved into input_html.
<%= f.input key, input_html: { class: 'form-control', autocomplete: 'on', multiple: true }, required: f.object.required?(key) %> 

INSTEAD OF

<%= f.input key, as: :multi_value, input_html: { class: 'form-control', autocomplete: 'on' }, required: f.object.required?(key) %> 

  1. Metadata Overwrites If you overwrite this file : app/models/concerns/hyrax/basic_metadata.rb you will need to add in these new Basic Fields
    1. Rights_Notes
    2. Abstract
    3. Alternative_Title
    4. Multiple v Singular

Share upgrade experience

Report on steps you took in addition to the above instructions

Clone this wiki locally