Backup, upgrade and recovery¶
What to back up¶
| What | Holds | How | Restore test |
|---|---|---|---|
| PostgreSQL | Everything Liftway knows: definitions, users, roles, runs, output, audit, encrypted Terraform plans and state | Your database tooling (e.g. pgBackRest with PITR) to storage outside the cluster | Restore into a separate database and start an isolated Liftway on it |
| Terraform encryption key | The key that decrypts plans, state and the assistant token | Your secret manager, stored separately from database backups, access-restricted | Read a Terraform state in the restored instance |
| Vault | Credential values | Your Vault team's snapshot procedure | Run a job that uses a credential |
| S3 bucket (if used) | Archived runner output | Provider replication or versioning | Open an old run's output |
| Deployment | Values file, image digest, Helm revision | Git (GitOps) | Re-render and compare |
Not needed: the cache, runner Jobs and pods, the controller's /data in HA mode.
Combinations matter:
- a database without the matching key restores configuration but not Terraform state;
- a database without Vault restores credential references whose values are gone — users must enter them again;
- a database and bucket from different points in time lose output.
The Terraform encryption key¶
The encryption-key in terraform.encryptionSecret is a Fernet key. It must be identical on every controller and in every future release. Online key rotation is not supported. If it is lost:
- saved plans cannot be applied — launch new plans;
- managed Terraform state cannot be read — recover from the real infrastructure with
terraform importinto a new workspace; - the assistant's stored API token must be re-entered.
Restore drill¶
Practise this before you need it, at least once and after major upgrades.
- Create an isolated namespace with an egress policy that blocks production targets and production Git write access.
- Restore the database into a new database; restore the same encryption key into the namespace; let the Vault team restore a snapshot to a test Vault, or point at a read-only test path.
- Flush the cache if the restored instance shares one; better, use none.
- Install Liftway with
replicas: 1, the restored database and the same key. - Immediately, as
admin: disable all schedules, and cancel any runs that were active at backup time. A restored database may contain pending approvals and schedules pointing at real infrastructure. - Check: sign-in, resources, history, output of old runs, a credential-using job against a test host, a Terraform state in the inspector.
- Record how long it took and how much data was lost; compare with your RPO and RTO.
Never restore an active production database unchanged into a second running Liftway.
Upgrades¶
Before:
- Fresh, verified database backup; note the current Helm revision and image tag
- Read release notes for schema or behaviour changes
- No Terraform apply in progress; ideally no long-running jobs
- For the first upgrade to the scoped scheduler,
controllerStrategy: Recreate
Then change only the image tag in your version-controlled values and apply (helm upgrade --install … --atomic --wait, or merge for GitOps). Controllers create or extend tables at start-up; there is no separate migration job. Runner Jobs keep running during the controller restart.
After: check readiness, run a harmless template, and watch the first scheduled runs.
Indexes on large databases¶
New versions may add indexes at start-up. On a large runs table, building an index can block writes for a while. For big installations, ask your DBA to create the new index CONCURRENTLY before rolling out.
Rollback¶
helm --kube-context prod-cluster -n runway-prod history runway
helm --kube-context prod-cluster -n runway-prod rollback runway <revision> --wait
helm rollback restores Kubernetes objects only — not the database schema, archived logs or infrastructure changed by runs. Roll back the application only if the previous version works with the current schema. Otherwise restore the database (and the bucket) to before the upgrade, with the matching key, into an isolated instance first, as in the drill above.
Never uninstall or delete PostgreSQL, Vault or volumes as a way to "roll back".
Uninstalling¶
helm uninstall removes Liftway's workloads. It leaves the data PVC (it carries helm.sh/resource-policy: keep), your external database, Vault data, Secrets you created and the bucket. Delete those deliberately, after a final backup.