Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DR 3004 migrate tiff image links #155

Open
wants to merge 6 commits into
base: qa
Choose a base branch
from

Conversation

croyfish
Copy link
Member

@croyfish croyfish commented Dec 20, 2024

This PR Contains the changes necessary to migrate Link Service links from Fedora to the IIIF image server on a local device. IT SHOULD NOT BE MEGED into the main line of development for any reason.

How to Test

  • Update your .env file with the following values:
IMAGE_FILESTORE_DATABASE_HOST=filestore-db
IMAGE_FILESTORE_DATABASE_NAME=image_filestore_development
IMAGE_FILESTORE_DATABASE_USER=root
IMAGE_FILESTORE_DATABASE_PASSWORD=mysqlpassword

AMI_FILESTORE_DATABASE_HOST=mms-postgres
AMI_FILESTORE_DATABASE_NAME=mms_development
AMI_FILESTORE_DATABASE_USER=postgres
  • Build the application with the latest changes using docker-compose build. Then, bring up the containers with docker-compse up.

Databases

  • Download original-link-test-db.sql.gz and mms_production-12-17-2024.sql.gz from db_dumps and unzip them.
  • Move original-link-test-db.sql to fedora_ingest_rails/database-data/mysql/ and move mms_production-12-17-2024.sql to fedora_ingest_rails/database-data/mms-postgres/
  • Create the development filestore db with docker-compose exec filestore-db sh -c "mysql -u root -p'mysqlpassword' -c 'CREATE DATABASE image_filestore_development;'"
  • Load in the unmigrated test filestore db with docker-compose exec filestore-db sh -c "mysql -u root -p'mysqlpassword' image_filestore_development < /database-data/mysql/original-link-test-db.sql"
  • Create the development mms db with docker-compose exec mms-postgres sh -c "psql -U postgres -c 'CREATE DATABASE mms_development;'"
  • Load in the mms production dump with docker-compose exec mms-postgres sh -c "psql -U postgres mms_development < /database-data/mms-postgres/mms_production-12-17-2024.sql"

Validation of Database Connectivity

  • Enter the webapp container with docker exec -it fedora_ingest_rails-webapp-1 bash and open a rails console with bundle exec rails c
  • Validate the Link Store database and check how many Fedora links are unmigrated with LinkStore.where("url LIKE ?", "%/fedora/%").count. There should be over 4 million results.
  • Validate the MMS database with Capture.first, and ensure a valid result is returned.

Test the migration

  • Leave the rails console. Then, run the URL migration rake task with bundle exec rake urls:migrate
  • The task should run for a couple of hours while printing updates for each 1000 URLs migrated. It should complete without error.
  • When the task has completed, do LinkStore.where("url LIKE ?", "%/fedora/%").count in a rails console again. The number of remaining legacy links should only be about 3300. This is because the links no longer exist in mms.

@croyfish croyfish requested review from emu47 and chrisb87 December 23, 2024 14:38
@croyfish croyfish changed the title Dr 3004 migrate tiff image links DR 3004 migrate tiff image links Dec 23, 2024
@croyfish croyfish marked this pull request as ready for review December 23, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants