Skip to content

Migration

Sean Crowe edited this page Oct 18, 2023 · 12 revisions

Metadata Preprocessing

Conservation Records

  1. In Access DB, prior to export, convert all date columns to date type, format mm/dd/yyyy.
  2. If present, remove extraneous "ID" column, likely the initial column
  3. Change column header "Item Record ." to "Item Record #"
  4. Staff Code, Staff Code2, StaffCode3: Check for errant integers, check for lower-case alpha characters, replace with blank or upper-case.
  5. Type In-house Repair, Type In-house Repair 2, Type In-house Repair 3: check for integers and replace with repair vocab strings.

Treatment Records

  1. Change column header "Item Record ." to "Item Record #"
  2. If present, remove extraneous "ID" column, likely the initial column

Data upload

Starting with a clean database:

  1. Run the migration to prepare the database.

    rails db:migrate

  2. Load users.

    rails batch:load_users CSV_LOCATION=/tmp/current_users.csv

  3. Load controlled vocabulary prior to other record types. All vocabularies are includes with the app in /lib/assets/.

    rails batch:department_controlled_vocabulary

    rails batch:housing_controlled_vocabulary

    rails batch:repair_type_controlled_vocabulary

    rails batch:contract_conservators_controlled_vocabulary

    rails batch:staff_code_controlled_vocabulary

  4. You must supply a csv in utf8 format with records, exported from the legacy access db. Conservation records have a one to one/many relationship with the other records, they anchor all other records types aside from controlled vocabulary.

    rails batch:conservation_records CSV_LOCATION=/tmp/Conservation-Data-with-headers.csv

  5. You must supply a csv in utf8 format with records, exported from the legacy access db. Treatment reports have a one-to-one relationship with conservation records.

    rails batch:treatment_reports CSV_LOCATION=/tmp/Treatment-Record.csv

Clone this wiki locally