Versions Compared

Key

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

This documentation is a work in progress.

Migrate Database

Dump r5 database

...

Data from your R5 database will be loaded directly into your R6 database then migrated for R6 in a later step. Role_map data will be needed in R6 for the Fedora migrate step, so it needs to be imported first.

Code Block
# This example is for mysql. Adjust as necessary for your R5 database
mysqldump -u avalonweb -p avalonweb --no-create-info --complete-insert --tables annotations api_tokens bookmarks courses identities ingest_batches playlist_items playlists role_maps  users > /tmp/avalon.r5.dump.sql

...


SSH into your r6 box, wipeout the database, and load the sqlite R5 database dump into your dbconsole.

Code Block
# ensure that Fedora, Solr, and the DB are clean
# it will ask you to verify the targets are correct
bundle exec rake avalon:wipeout  
 
#go into the database console and import sqlite data
bundle exec rails dbconsole
mysql> source /tmp/avalon.r5.dump

...

Add yourself back in as administrator in the rails console

Code Block
bundle exec rails c
> g = Admin::Group.find('administrator')
> g.users += ["archivist1@example.com"]
> g.save!

Clear role_map cache (TODO: fix me)

Rails won't use your newly imported role_map data unless you clear it from cache.

Code Block
languagebash
bundle exec rails c
> Rails.cache.delete("RoleMapHash")

...

SSH tunnel or open up your fedora3 server to your new Avalon app:

Code Block
#port 9999 stands for your local# Choose an available local port to use as a mirror of your fedora3.host:8983 import source
#if# In this example 9999 doesn't work, try another port nearbyis used. It must match the port used in fedora3.yml in the next step
ssh -L 9999:localhost:8983 user@fedora3.host

...

Run the migration! You can watch it run on your target avalon by going to <you <your avalon url>/admin/migration_report .

...