Skip to content

Migration

Sean Crowe edited this page Feb 22, 2024 · 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. Best practice is to use LibreOffice and save csv format in utf8. Make sure to scrutinize delimiters and ensure semicolons are NOT used as delimiter.
  4. Change column header "Item Record ." to "Item Record #"
  5. Staff Code, Staff Code2, StaffCode3: Check for errant integers, check for lower-case alpha characters, replace with blank or upper-case.
  6. Type In-house Repair, Type In-house Repair 2, Type In-house Repair 3: check for integers and replace with repair vocab strings.
  7. Check Department to confirm presence of strings (not IDs) and no blanks
  8. Normalize names in Preformed In-house Repair ...

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. Deactivate/comment-out model validations for In-house and External repairs.

  5. 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

  6. 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