Skip to content
Justin Coyne edited this page Dec 19, 2018 · 6 revisions

Plan for migrating from Oracle to PostgreSQL:

  1. Scope the problem. Get a count of workflow and workflow_archive
    • 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 workflow_archive.
  3. Export workflow_archive to a CSV?
  4. Import the CSV as workflows
  5. Export workflow to a CSV.
  6. Import the CSV, while calculating the current version for each row.