Features

Data & releases

GAHobby, Pro, Scale

Roll back your app and its managed PostgreSQL database together

Undo a broken release across both application code and managed PostgreSQL in one phased operation that preserves post-deploy writes in the original database.

Updated

Roll back code and database together, or restore data independently

Rolling back an application container without reversing its schema migration often leaves production broken. Gregale coordinates code rollback and managed PostgreSQL point-in-time recovery as one tracked switch, staging and verifying credentials on the restored database copy before fencing traffic.

bash
gregale rollback my-api --to v41 --restore-databases

# Or restore only the database and switch the app without changing code
gregale postgres restore orders --name orders-0900 --point-in-time 2026-11-26T09:00:00Z --switch my-api

Key capabilities

Undoes release migrations automatically

Pass --restore-databases to restore each database migrated by undone releases back to the exact start timestamp of the earliest replaced release command.

Non-destructive copy semantics

Restores into a new database (<name>-before-v<revision>) so writes recorded after the restore point stay intact in the original database.

Verified phased cutover

Your current release keeps serving while Gregale restores the copy, stages credentials, and checks SQL connectivity before fencing and switching the app.

Data-only switch without code changes

When code is healthy and data is not, restore a managed PostgreSQL database to any timestamp in its 7-day window and switch the app in place.

Typical PaaS vs. Gregale

CapabilityTypical PaaSGregale
Coordinated code + DB rollbackReverts image only; manual DB backup restore and rebindOne CLI command restores both to the migration boundary
Post-incident writes preservationIn-place restores risk overwriting recent rowsCreates a new restored copy and leaves original DB intact
Credential verificationApp boots and discovers broken credentials liveStages and verifies SQL credentials before fencing traffic

Deep-dive guides (4)

Runnable starters & integrations (4)

Browse all templates

Documentation references

Questions

Does --restore-databases overwrite my existing PostgreSQL database?

No. Gregale restores a new database named <name>-before-v<revision> and rebinds the app to it. All writes that landed in the original database after the restore point remain untouched until you explicitly delete the old database.

Can I restore a database and switch my app without rolling back application code?

Yes. Run gregale postgres restore <db> --name <new-name> --point-in-time <timestamp> --switch <app> to execute the same credential staging, fencing, drain, and switch flow while keeping the current code release.

Is there brief downtime during a database-synced rollback?

While the database copy restores and SQL credentials are checked, the app continues serving. Gregale then fences traffic, drains active instances, switches the binding and release, and resumes the app (typically under a minute plus wake time).