Version 1.0.1
Version 1.0.0 was accidentally released from the master branch. In order to correct this we yanked version 1.0.0 and pushed a version from the correct (1-0-stable) branch as 1.0.1.
This release provides a bridge from Sufia 7.3 to Hyrax.
Upgrade Notes
Getting started
- Upgrade to Rails 5.0.x
- Replace the
sufia
gem withhyrax
(1.0.0) in your application's Gemfile, and runbundle install
- Make sure any tweaks made in the Sufia or CC initializer move over into the Hyrax initializer. To do this, copy the Hyrax 1.0.0 initializer to
config/initializers/hyrax.rb
, then update it to include changes you have made to your CurationConcerns & Sufia initializers (at which point you should be able to safely remove the old initializers) - Global search & replace Sufia and CurationConcerns to Hyrax, on file names, folder names, and file contents. Note that while it should be safe to replace 'sufia' with 'hyrax', 'Sufia' with 'Hyrax', and 'CurationConcerns' with 'Hyrax', it is not safe to automate replacement of 'curation_concerns' with 'hyrax'. Lean on version control here to make sure you don't make any changes that will cause problems later. You may find that this process causes some duplicate lines -- go through and remove those now.
Routes
- Remove
Hydra::BatchEdit.add_routes(self)
- Remove
curation_concerns_collections
Models
- Create a database migration to rename the
sufia_features
table tohyrax_features
- Install Hyrax's database migrations:
rails hyrax:install:migrations
(You may see a bunch of warnings here about Hyrax's migrations looking similar to Sufia's. That's to be expected.) - Create a new migration via
rails g migration RemoveWorkflowNameFromPermissionTemplates
. Make sure it includes the following method definition:
def change
remove_column :permission_templates, :workflow_name, :string
end
- Run
rails db:migrate
Controllers
- Remove
include CurationConcerns::CurationConcernController
from all controllers. - Ensure that
self.curation_concern_type = YourWorkTypeHere
comes afterinclude Hyrax::WorksControllerBehavior
in your work type controllers - Remove
include Hyrax::Catalog
fromapp/controllers/catalog_controller.rb
- Change
config.search_builder_class
inapp/controllers/catalog_controller.rb
to equalHyrax::CatalogSearchBuilder
- Remove
include Hyrax::ApplicationControllerBehavior
fromapp/controllers/application_controller.rb
- Remove
app/controllers/hyrax/admin_controller.rb
since theAdminControllerBehavior
no longer exists
Views
If you've overridden or created any static pages in your application, you will need to move them from app/views/static/
to app/views/hyrax/static/
.
Minter state
- Install the new database-backed identifier minter (if not already done) via
rails generate active_fedora:noid:install
- Migrate your database again via
rails db:migrate
- Migrate your file-based minter state to the new db-based minter state via
rails active_fedora:noid:migrate:file_to_database
Other steps
- You should be able to safely remove
app/helpers/curation_concerns_helper.rb
- Remove the files
app/assets/javascripts/batch_edit.js
andapp/assets/stylesheets/batch_edit.scss
- Add Blacklight internationalization keys (from CurationConcerns) to
config/locales/hyrax.en.yml
in your application if not already present: https://github.com/projecthydra-labs/hyrax/blob/037d75dcf979b0a37536e03a4bef40415813734d/lib/generators/hyrax/templates/config/locales/hyrax.en.yml#L1-L44 - For each work type (or "curation concern") you generated in Sufia, regenerate them with Hyrax's work generator. It should prompt you whether you want to override files. You may want to do this and then examine the changes it made, restoring any customizations your application requires. (Again, version control will be your friend here.)
AdminSet Workflow
- Workflows changed subtly between Sufia 7.3 and Hyrax such that now an AdminSet has both available workflows and an active workflow. No tools have yet been built to automate mapping workflows into the new structure, so you should make sure workflows are loaded (
rails hyrax:workflow:load
) and then use the UI to make sure a workflow is selected for each of your AdminSets. - Ensure a Hyrax::PermissionTemplate exists for your each of your AdminSets. You can create this for the Default AdminSet via:
permission_template = Hyrax::PermissionTemplate.create!(admin_set_id: "admin_set/default")
Hyrax::Workflow::WorkflowImporter.method(:load_workflow_for).call(permission_template: permission_template)
workflow = Sipity::Workflow.activate!(permission_template: permission_template, workflow_name: Hyrax.config.default_active_workflow_name)
# Run the following steps only for the default AdminSet
permission_template.access_grants.create(agent_type: 'group', agent_id: 'registered', access: 'deposit')
deposit = Sipity::Role.find_by_name!('depositing')
workflow.update_responsibilities(role: deposit, agents: Hyrax::Group.new('registered'))
Data Migration
Sufia 7.3 utilized CurationConcerns 1.7, but Hyrax was created from CurationConcerns 2.0. Collection membership changed direction as part of CC 2.0. Run the data migration script that reverses this membershp on your objects:
rails hyrax:migrate:collections RAILS_ENV=production
Contributing to the Release Notes
As you are migrating your application from Sufia to Hyrax, if you encounter missed steps, please submit an issue to the Hyrax team.