Currently due to some issues with the S3 recovery we've got a bit of an issue with the Fedora restore so this information is current as of 7/5/16.
Backup
If something goes wrong, go to
EC2→Snapshots
Then select the snapshot(s) you want to restore (opt and fed_data) and you have a new opt and fedora setup disk.
Run Ansible and capistrano to build a fresh machine and when it comes up, turn it off. Detach the automatically generated /opt disk (/dev/xvdg or /dev/sdg by name).
Attach the restored opt and fedora disk.
Go to S3 and download the minter-state and postgres backup files.
Move Minter state to it's new location. (/var/sufia) Note: You may need to make /var/sufia with sudo mkdir /var/sufia if it does not exist yet.
Change ownership for the minter state to the owner (hydep) and the group (deploy)
Command: sudo chmod -R hydep:deploy /var/sufia
In Postgres delete the automatically generated chf_hydra database
Log in via
psql -u postgres
and run
DROP DATABASE chf_hydra;
make a blank database chf_hydra
CREATE DATABASE chf_hydra;
Then import the downloaded database
Either:
pg_restore -d chf_hydra -U postgres chf_hydra.dump
or
psql chf_hydra < chf_hydra_dump.sql
Then set permissions by logging in
psql -U postgres
Once logged in run
GRANT Create,Connect,Temporary ON DATABASE chf_hydra TO chf_pg_hydra;
The postgres account password is in ansible-vault (groupvars/all)
After that restart postgres, Tomcat, and Apache.