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.
As of 7/21 a test using Staging data worked well with the S3 storage method and things are back in gear.
Here is the current backup strategy as a diagram:
...
FedoraBackup (contains all Fedora binary data)
PGSql (contains the Fedora Postgres database fcrepo_backup)
Both sets are needed to do a full restore.
...
- Stop Tomcat
- Download the Postgres database fcrepo_backup.sql to the Fedora machine.
- Fedora might still have active connections to postgres, a restart
sudo service postgresql restart
will kill them. - Import the database psql fcrepo < fcrepo_backup.sql
- If the database already exists, such as a sync, you will want to drop the existing database and then run the command.
- Check that the user trilby has permissions to access and use the newly made fcrepo database.
- Delete the existing folder(s) inside
/opt/fedora-data
(This step is not always required but makes it simpler) - Using screen or tmux start an aws s3 sync to copy all the data over in the FedoraBackup "folder" to
/opt/fedora-data
- Wait a while for all the data (>800 GB) to copy over.
- Run
chown -R tomcat7:tomcat7 /opt/fedora-data
to give ownership on the new files to the tomcat user so Fedora can access them. - Restart Tomcat
- This will migrate restore the Fedora database. Current cost estimates (2/18) are about $.10 to do this restore.
Users:
- Go to S3 and download the postgres backup files.
- Stop Apache
- Restart the postgres service, this should remove the default connection to the Hydra database that Hydra has when running so you can change it.
- In Postgres delete the automatically generated chf_hydra database
- Log in via psql -u postgres
- The postgres account password is in ansible-vault (groupvars/all)
- Run: DROP DATABASE chf_hydra;
- Run: CREATE DATABASE chf_hydra;
- Log in via psql -u postgres
- Then import the downloaded database
- Either:
- pg_restore -d chf_hydra -U postgres chf_hydra.dump
- psql chf_hydra < chf_hydra_dump.sql
- Either:
- Then set permissions
- psql -U postgres
- GRANT Create,Connect,Temporary ON DATABASE chf_hydra TO chf_pg_hydra;
- You may now restart postgres and Apache2
...