Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Before running the migration, you can dump the section lists stored in ordered_master_file_ids by running:

Code Block
RAILS_ENV=production bundle exec rails r "ActiveFedora::SolrService.instance.conn.get('select', params: { rows: 1_000_000, q: 'has_model_ssim:MediaObject', fl: [:id, :section_id_ssim], sort: 'id asc' })['response']['docs'].each {|doc| puts \"#{doc['id']}: section_ids: #{doc['section_id_ssim'] || []}\" }" > log/section_list_dump.pre_migration.txt

...

After the migration, run the following line to dump again and validate that the section lists, now stored in section_ids matches the one dumped prior to the migration:

Code Block
RAILS_ENV=production bundle exec rails r "ActiveFedora::SolrService.instance.conn.get('select', params: { rows: 1_000_000, q: 'has_model_ssim:MediaObject', fl: [:id, :section_list_ssim], sort: 'id asc' })['response']['docs'].each {|doc| puts \"#{doc['id']}: section_ids: #{JSON.parse(doc['section_list_ssim'].first || '[]').to_s}\" }" > log/section_list_dump.post_migration.txt
diff -awu log/section_list_dump.pre_migration.txt log/section_list_dump.post_migration.txt

...