-
Notifications
You must be signed in to change notification settings - Fork 1
Migration Plan
Justin Coyne edited this page Dec 19, 2018
·
7 revisions
- Scope the problem. Get a count of legacy
workflow
and legacyworkflow_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)
- On workflow-server-rails
- Disable the workflow-archiver-job (remove from crontab) so that no new rows get added to legacy
workflow_archive
. - Export legacy
workflow_archive
to a CSV? - Import the CSV as
workflows
- Select all the unique druids in legacy
workflow
- For each druid, query dor-services-app to get the current version:
version = dor_conn.get("/v1/objects/#{druid}/versions/current").body
- See https://github.com/sul-dlss/workflow-archiver/blob/5f0cb9b2282fb837b5b5accd72b72b3dc2882040/lib/dor/workflow_archiver.rb#L28
- Then query all the rows matching that druid from the legacy
workflow
table, and insert them into theworkflows
table with the version we got from dor-services-app. - Update the archive action from dor-services-app
- I think this can be a no-op, and eventually be removed.
- called from https://github.com/sul-dlss/dor-services/blob/517c9f147c51ec852fcc28c831ceddb860619a0d/lib/dor/services/merge_service.rb#L73)
- https://github.com/sul-dlss/dor-services-app/blob/094f1dce407f6f6d5d4acecb95ff7d074c027d31/app/controllers/workflows_controller.rb#L8-L13
- Update the sul-lyberservices-* proxy to point at the new workflow service.
- Decommission workflow-archiver-job and deprecate workflow-archiver
- Decommission old Java workflow service.