{"id":14973906,"url":"https://github.com/riotkit-org/br-pgbr","last_synced_at":"2026-02-14T17:06:57.667Z","repository":{"id":38256296,"uuid":"472091759","full_name":"riotkit-org/br-pgbr","owner":"riotkit-org","description":"PostgreSQL backup helper. Portable, single-binary backup \u0026 restore with automated restore procedure","archived":false,"fork":false,"pushed_at":"2023-06-26T23:57:58.000Z","size":305,"stargazers_count":5,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-30T17:53:56.964Z","etag":null,"topics":["backup-repository","database","pgbr","pgdump","pgrestore","pgsql","pgsql-backup","postgres","postgres-backup","postgresql","psql","single-binary"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/riotkit-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-03-20T20:13:37.000Z","updated_at":"2025-12-06T02:56:50.000Z","dependencies_parsed_at":"2024-01-24T05:49:33.254Z","dependency_job_id":"41438013-00c3-4b16-b901-49e235f90a19","html_url":"https://github.com/riotkit-org/br-pgbr","commit_stats":null,"previous_names":["riotkit-org/br-pg-simple-backup"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/riotkit-org/br-pgbr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riotkit-org%2Fbr-pgbr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riotkit-org%2Fbr-pgbr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riotkit-org%2Fbr-pgbr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riotkit-org%2Fbr-pgbr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riotkit-org","download_url":"https://codeload.github.com/riotkit-org/br-pgbr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riotkit-org%2Fbr-pgbr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29450654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup-repository","database","pgbr","pgdump","pgrestore","pgsql","pgsql-backup","postgres","postgres-backup","postgresql","psql","single-binary"],"created_at":"2024-09-24T13:49:39.834Z","updated_at":"2026-02-14T17:06:57.637Z","avatar_url":"https://github.com/riotkit-org.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"pgbr\n====\n\nPostgreSQL simple backup \u0026amp; restore helper tool created for usage with Backup Repository, but can be used also standalone.\n\n**Features:**\n- Opinionated backup \u0026 restore commands basing on PostgreSQL built-in commands\n\n**Requirements:**\n- Linux (x86_64/amd64 architecture)\n- PostgreSQL in desired version\n\nConception\n----------\n\n**Sensible defaults**\n\nBackup \u0026 Restore should be simple and fault-tolerant, that's why this tool is automating basic things like disconnecting clients, or connecting\nto database using an empty database schema during restore - we cannot restore database we connect to, also we cannot recreate from backup something that is in use.\n\nBoth `pgbr db backup` and `pgbr db restore` should work out-of-the-box with sensible defaults.\n\nBackup\n------\n\nSelected database or all databases are dumped into a `custom formatted` file, readable by `pg_restore`.\n\n```bash\n# for single database \"pbr\"\npgbr db backup --password riotkit --user riotkit --db-name pbr \u003e dump.gz\n\n# for all databases\npgbr db backup --password riotkit --user riotkit \u003e dump.gz\n```\n\n\nRestore\n-------\n\nProcedure:\n1) Existing connections to selected one database, or to all databases are terminated\n2) Selected database, or all databases are closed for incoming connections\n3) Selected database, or all databases are recreated from backup using `pg_restore`, which uses `--clean` and `--create` by default\n\n```bash\ncat dump.gz | ./.build/pgbr db restore --password riotkit --user riotkit --connection-database=postgres\n```\n\nPassing extra arguments\n-----------------------\n\nBoth `pgbr db backup` and `pgbr db restore` are supporting UNIX-like parameters passing to subprocess, which is `pg_dump`/`pg_dumpall` for **Backup** and `pg_restore` for **Restore**.\n\n**Example**\n\n```bash\npgbr db backup --password riotkit --user riotkit -- --role=my-role \u003e dump.gz\n```\n\nUsing tooling from docker image\n-------------------------------\n\n`pgbr` can rely on your host OS or use `docker run` to trigger `psql`, `pg_dump`, `pg_dumpall` or `pg_restore`.\n\nIn order to use a docker image that will provide client tools you can set those environment variables:\n\n```bash\nexport PGBR_USE_CONTAINER=true\nexport POSTGRES_VERSION=15\n\n# optional: image name\nexport PGBR_CONTAINER_IMAGE=my-registry/image-name \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friotkit-org%2Fbr-pgbr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friotkit-org%2Fbr-pgbr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friotkit-org%2Fbr-pgbr/lists"}