After bringing up a fresh instance on a cluster:
Restore the backup secret from production into the target cluster, or build it from the config and password.
Setup restore pod:
kubectl --context dallas-stage --namespace languagedepot-dev apply -f .\kopia-maint.yamlConnect to the kopia pod:
kubectl --context dallas-stage --namespace languagedepot-dev exec -it pod/kopia-maint -c kopia -- /bin/bashHelpful kopia commands:
kopia repostory status
kopia snapshot list -al
# list files in a snapshot
kopia ls {snapshot id}Postgres database restore:
kopai restore {snapshot id} /dump/restore-$(date -I)Now you need to switch to the pg container to run the restore.
Connect to the pg pod:
kubectl --context dallas-stage --namespace languagedepot-dev exec -it pod/kopia-maint -c pg -- /bin/bashRun the restore: (note that the /dump path is mounted in both containers)
pg_restore -U postgres -v -h db.languagedepot -d $PGDATABASE /dump/restore-{date from previous step}Note: include -c when doing the restore to clear the current DB first.
Restore from a specific spanshot directly into hg repos:
kopia restore k4de77b4722704a4db051e8929df64ac0/e/elawa200810 /hg-repos/e/elawa200810 --no-overwrite-files --no-overwrite-directories