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
    1. ActiveRecord::Base.connection.query('SELECT count(*) from workflow_archive')
    2. ActiveRecord::Base.connection.query('SELECT count(*) from workflow')
  • On workflow-archiver-job
    1. DB = Dor::WorkflowArchiver.new.conn
    2. DB.fetch('SELECT count(*) from workflow').first[:'count(*)'] (currently 572785)
    3. DB.fetch('SELECT count(*) from workflow_archive').first[:'count(*)'] (currently 126,069,766)
  1. Disable the workflow-archiver-job (remove from crontab) so that no new rows get added to workflow_archive.
  2. Export workflow_archive to a CSV?
  3. Import the CSV as workflows
  4. Export workflow to a CSV.
  5. Import the CSV, while calculating the current version for each row.