Skip to content

Migration Plan

Justin Coyne edited this page Dec 19, 2018 · 7 revisions

Plan for migrating from Oracle to PostgreSQL:

  1. Scope the problem. Get a count of legacy workflow and legacy workflow_archive tables
    • On workflow-server-rails
      • ActiveRecord::Base.connection.query('SELECT count(*) from workflow_archive')
      • ActiveRecord::Base.connection.query('SELECT count(*) from workflow')
    • On workflow-archiver-job
      • DB = Dor::WorkflowArchiver.new.conn
      • DB.fetch('SELECT count(*) from workflow').first[:'count(*)'] (currently 572785)
      • DB.fetch('SELECT count(*) from workflow_archive').first[:'count(*)'] (currently 126,069,766)
  2. Disable the workflow-archiver-job (remove from crontab) so that no new rows get added to legacy workflow_archive.
  3. Export legacy workflow_archive to a CSV?
  4. Import the CSV as workflows
  5. Select all the unique druids in legacy workflow
  6. For each druid, query dor-services-app to get the current version:
  7. Then query all the rows matching that druid from the legacy workflow table, and insert them into the workflows table with the version we got from dor-services-app.
  8. Update the archive action from dor-services-app
  9. Update the sul-lyberservices-* proxy to point at the new workflow service.
  10. Decommission workflow-archiver-job and deprecate workflow-archiver
  11. Decommission old Java workflow service.