sillsdev / languageforge-lexbox

Lexbox, SIL linguistic data hub
MIT License
7 stars 2 forks source link

Create a kopia restore job #1184

Open hahn-kev opened 3 weeks ago

hahn-kev commented 3 weeks ago

Describe the feature Right now we have the backup job here https://github.com/sillsdev/languageforge-lexbox/blob/17987f3510a725a2369673d587e6d460c2f59c8c/deployment/production/backup.yaml I would like to make a similar job (which is manually ran) which will restore from back to the local instance of lexbox. Here's the workflow

  1. check that the hg-repos volume is empty (there should only be a bunch of empty folders)
  2. check that the postgres db is empty (save for the migrations table?)
  3. restore the backup into a emptyDir volume on the job
  4. validation???
  5. copy the hg-repos backup into the hg-repos volume
  6. restore postgres with a command like this (untested) pg_restore -U postgres -v -h db.languagedepot -d $PGDATABASE /dump/postgres-backup, this may have issues because lexbox already created the schema, in which case it probably make the most sense to also use the -c flag which will clean the db before the restore process.

Who is this feature for? k8s admins