ownstack db

Health

$ ownstack db check        [--app=NAME] [--stack=STACK]
$ ownstack db repair       [--app=NAME] [--stack=STACK]
$ ownstack db reset-password [--app=NAME] [--stack=STACK]   # alias for repair
$ ownstack db version      [--app=NAME]
$ ownstack db status       [--app=NAME]
$ ownstack db logs         [--app=NAME]

db check verifies connectivity and authentication. db repair re-links the DB, refreshes DATABASE_URL, and resyncs the role password to dokku's stored DSN. For drift caused by a Postgres dump-restore, see Repair after import insteaddb repair aligns to the wrong target in that case.

Dump

$ ownstack db dump [--app=NAME] [--stack=ID] [--output=FILE]

Streams a Postgres custom-format dump or MySQL gzipped SQL to a local file. Auto-detects type. See Dumps.

Heroku-side backups (for migration)

$ ownstack db backups --heroku-app=NAME [--app=NAME]
$ ownstack db backups:capture --heroku-app=NAME [--app=NAME]

Restore

$ ownstack db restore --heroku-app=NAME [--backup=NUM]
$ ownstack db restore --url=URL [--app=NAME]
$ ownstack db restore:info ID [--app=NAME] [--follow]
$ ownstack db restore:cancel ID [--app=NAME]
$ ownstack db restores [--app=NAME]

Lifecycle

CommandWhat it does
ownstack db create [--app=NAME] [--version=17]Create + link a Postgres service.
ownstack db destroy [--app=NAME] [--force]Destroy service + data. Irreversible.
ownstack db recreate [--app=NAME] [--version=17]Destroy + recreate fresh.
ownstack db link [--app=NAME]Re-link existing service to the app.
Don't recreate on prod

db recreate destroys before re-creating — there's no path back. Use it for development stacks; never on production.