Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Fedora 3 to Fedora 4 Migration

Adam Wead edited this page Feb 28, 2015 · 8 revisions

Below are the steps to audit the Fedora 3 to Fedora 4 migration. The basic workflow is as follows:

  1. Gather the list of all objects in the Fedora 3 repo and store them in a MySQL table.
  2. Migrate the data.
  3. Loop through all the Fedora 3 objects in the MySQL table and make sure that (a) they exist in the Fedora 4 repo and (b) their model (Batch, Collection, GenericFile) matches with their model in the Fedora 3 repo.

You can perform steps 1 and 2 in whatever order. The only requirement to perform step 1 is that you have access (i.e. the URL) to a running Fedora 3 repo with the original data.

Steps 1 and 3 are accomplished via rake tasks available in the code base that supports Fedora 4.

STEP 1

To gather information about all the objects in the Fedora 3 repository run the following rake task:

RAILS_ENV=production bundle exec rake premigrate:f3_audit["/path/to/fedora3.yml"]

Once this rake task completes, you can see the information gathered about the Fedora 3 objects by querying MySQL directly:

mysql -umysql_user -pmysql_pwd -hmysql_host
select * from migrate_audits;

STEP 2

To migrate the data, first clear out any existing Fedora 4 data:

bundle exec rake fedora:migrate:reset RAILS_ENV=production

This may fail, in which case you can delete the data directly off of your Fedora server

ssh ssrepo2qa
cd /opt/heracles/fedora/data
rm -Rf *
service tomcat restart

Verify Fedora has restarted by listing the current directory and you should see

fcrepo.activemq.dir  fcrepo.ispn.repo.CacheDirPath

Go ahead and re-run:

bundle exec rake fedora:migrate:reset RAILS_ENV=production

Then, run the migration rake task:

nohup time bundle exec rake scholarsphere:migrate:repository RAILS_ENV=production &

This executes in in the background and ignores hangup signals. You'll want to logout as the migration will take several hours. When it's finished, you'll have a report.json file with the results and nohup.out will tell you how long it took.

STEP 3

After the Fedora 3 data has been migrated to a Fedora 4 repository, run the following rake task:

RAILS_ENV=production bundle exec rake aftermigrate:f4_audit

This task will make sure every Fedora 3 object listed in the MySQL table exists in the Fedora 4 repo and that the model for the object in Fedora 4 matches the model that the object had in Fedora 3. This task will update the MySQL table with the status of the audit for each object. To get a list of objects that failed the audit issue the following query:

mysql -umysql_user -pmysql_pwd -hmysql_host
select * from migrate_audits where status != "OK";
Clone this wiki locally