Skip to content
LaRita Robinson edited this page Nov 29, 2026 · 4 revisions

Bulkrax's install generator copies a command line script, bin/importer, meant to create and update importers through the JSON API. This page explains its state in Bulkrax 10.0 and what to use instead.

On this page

Status in Bulkrax 10.0

The script does not work in Bulkrax 10.0:

  • Run with any options, it stops with NameError: undefined local variable or method 'opts' before sending a request.
  • It needs the slop gem, which Bulkrax does not install.
  • It needs config/bulkrax_api.yml, which the generator creates but Hyku does not include.
  • Even with those fixed, creating an importer through the API it calls fails in Bulkrax 10.0 (see JSON API).

Hyku does not include the script.

Alternatives

  • Create and run importers in the web interface: Importers User Interface.

  • From a Rails console or a script run with rails runner, create an importer and start it directly:

    importer = Bulkrax::Importer.create!(
      name: 'Batch 12',
      user: User.find_by(email: 'admin@example.edu'),
      admin_set_id: Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id.to_s,
      parser_klass: 'Bulkrax::CsvParser',
      frequency: 'PT0S',
      field_mapping: Bulkrax.field_mappings['Bulkrax::CsvParser'],
      parser_fields: { 'import_file_path' => '/imports/batch_12/metadata.csv', 'visibility' => 'open' }
    )
    Bulkrax::ImporterJob.perform_later(importer.id)

    The example uses the default admin set; to use another, give its id. In Hyku, switch to the tenant first, for example with AccountElevator.switch!('tenant.example.edu').

Clone this wiki locally