Skip to content

Upgrade Hyrax 3.x to Hyrax 4

Daniel Pierce edited this page Aug 12, 2022 · 8 revisions

Here are the steps to upgrade from Hyrax 3.x to Hyrax 4 (beta). During beta we would like to hear about additional steps needed to upgrade successfully, so please share! Edit this wiki page and share with the community.

Upgrade instructions - Getting started

These instructions are based on updating nurax to hyrax 4.0.

  • Update Gemfile to specify these gems:

    • gem 'rails', '~> 6.0.5'
    • gem 'hyrax', '~> 4.0'
    • gem 'sass-rails', '~> 6.0'
    • gem 'bootstrap', '~> 4.0'
  • run bundle update

    • If this command takes an abnormally long time to complete, try deleting Gemfile.lock and retry.
  • Update app/assets/javascripts/application.js as follows:

    • Change //= require jquery to //= require jquery3

    • Change //= require jquery_ujs to //= require rails-ujs (Note the hyphen)

    • Change //= require dataTables/jquery.dataTables to //= require jquery.dataTables

    • Change //= require dataTables/bootstrap/3/jquery.dataTables.bootstrap to //= require dataTables.bootstrap4

    • Add these three lines after //= require rails-ujs:

      //= require popper
      //= require twitter/typeahead
      //= require bootstrap
      
    • Add //= require blacklight_gallery after //= require blacklight/blacklight

  • Update app/assets/stylesheets/application.css as follows:

    • Change *= require dataTables/bootstrap/3/jquery.dataTables.bootstrap to *= require dataTables.bootstrap4
  • Update app/assets/stylesheets/hyrax.scss as follows:

    • Remove @import "bootstrap-sprockets";
    • Add @import "hyrax/blacklight_gallery"; after any other blacklight_gallery lines and before @import 'hyrax/hyrax';
  • In app/controllers/application_controller.rb remove skip_after_action :discard_flash_if_xhr

  • In app/models/user.rb remove:

    if Blacklight::Utils.needs_attr_accessible?
      attr_accessible :email, :password, :password_confirmation
    end
    
  • Check that config/analytics.yml is updated to match the new format.

  • In config/initializers/hyrax.rb remove config.google_analytics_id setting.

  • In config/initializers/riiif.rb update capitalization of Riiif::Image.authorization_service = Hyrax::IiifAuthorizationService

Depending on the amount of customization present in your hyrax application, more changes may be needed. In particular, many Bootstrap CSS class names were updated in this release.

Share upgrade experience

  • Report on steps you took in addition to the above instructions
Clone this wiki locally