Skip to main content

Backup and restore

Bare Metal

Backup

PGPASSWORD="YOUR_PASSWORD" pg_dump -U kbin kbin > dump.sql

Restore

psql -U kbin kbin < dump.sql

Docker

Backup:

docker compose exec -it db pg_dump -U kbin kbin > dump.sql

Restore:

docker compose exec -T db psql -U kbin kbin < dump.sql