Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

General outline

  1. Spin up machine
  2. Deploy Sufia
  3. Ensure apache is off
  4. Activate maintenance mode on old server
  5. Move over minter
  6. Fedora Export - see below
  7. migrate postgres
  8. Fedora Import - see below
  9. run (currently nonexistent) verification job
  10. migrate dump.rdb
  11. Reindex solr

Fedora export

In sufia 6 instance:

  • Run audit script
RAILS_ENV=production bundle exec sufia_survey -v
  • Run json export
$ RAILS_ENV=production bundle exec sufia_export --models GenericFile=Chf::Export::GenericFileConverter,Collection=Chf::Export::CollectionConverter
  • Open up fedora port to the other server so it can grab the binaries
  • Change all the 127.0.0.1 URIs to reflect actual host, e.g.
$ find tmp/export -type f -name "*.json" -print0 | xargs -0 sed -i "s/127\.0\.0\.1/staging.hydra.chemheritage.org/g"
  • Move the resulting directory full of exported data from tmp/export to the new server's tmp/import (or wherever desired; this can be provided to the import script)
$ cd tmp; tar -czf json_export_201611141510.tgz export
  • Then from your own machine:
$ scp staging:/opt/sufia-project/current/tmp/json_export_201611141510.tgz new_box_ip:/opt/sufia-project/current/tmp/.

Fedora import

On sufia 7 instance:

  • unpack the exported json files
cd opt/sufia-project/current/tmp/
tar -xzf json_export_201611141510.tgz
mv export import
  • configure sufia6_user and sufia6_password in config/application
  • run the import
$ RAILS_ENV=production bundle exec sufia_import -d tmp/import --json_mapping Chf::Import::GenericFileTranslator=generic_file_
  • You can use the little bash script I wrote to create batches of files if you want. It's at /opt/sufia-project/batch_imports.sh
$ RAILS_ENV=production bundle exec sufia_import -d /opt/sufia-project/import/gf_batch_0 --json_mapping Chf::Import::GenericFileTranslator=generic_file_

Misc.

Postgres

You can get a list of all tables and fields with the command:

SELECT * FROM information_schema.columns WHERE table_schema = 'public'

  • No labels