{"id":30705104,"url":"https://github.com/manydesigns/dbdump","last_synced_at":"2025-09-02T18:10:00.151Z","repository":{"id":311721793,"uuid":"1040572424","full_name":"ManyDesigns/dbdump","owner":"ManyDesigns","description":"Utility to dump and upload compressed DBs dumps to S3 and restore them.","archived":false,"fork":false,"pushed_at":"2025-08-26T07:20:54.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-26T07:30:15.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ManyDesigns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-19T07:23:32.000Z","updated_at":"2025-08-26T07:20:58.000Z","dependencies_parsed_at":"2025-08-26T07:30:18.094Z","dependency_job_id":"282aec0f-4cb2-4130-8c0d-57259d1417ee","html_url":"https://github.com/ManyDesigns/dbdump","commit_stats":null,"previous_names":["manydesigns/dbdump"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ManyDesigns/dbdump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyDesigns%2Fdbdump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyDesigns%2Fdbdump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyDesigns%2Fdbdump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyDesigns%2Fdbdump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManyDesigns","download_url":"https://codeload.github.com/ManyDesigns/dbdump/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManyDesigns%2Fdbdump/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273326415,"owners_count":25085746,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-02T18:09:57.663Z","updated_at":"2025-09-02T18:10:00.140Z","avatar_url":"https://github.com/ManyDesigns.png","language":"Go","readme":"# Dbdump\n\nThis tool is a wrapper for PostgreSQL's native `pg_dump` and `pg_restore` commands (in the future, others DB engines will\nbe added) and basically add the option to upload a DB dump to an S3 bucket.\n\nThe **main goal** of this tool, is to allow Developers or whoever need it, to be able to generate a DB dump in a remote\nsystem, which does have a working connection to the Internet network, but, users are denied to download/upload files from it\nto their local machines directly.\n\nThe secondary goal is to have a standard dump format (a custom compressed archive) for everyone. You can not change\n(add/remove) parameters.\n\nWe use `pg_dump` command here to perform the dump. Followin is a list and meaning of the parameters used:\n- `-h` -\u003e database server host or socket directory\n- `-p` -\u003e database server port number\n- `-U` -\u003e connect as specified database user\n- `-d` -\u003e database to dump\n- `-O` -\u003e prevents `ALTER OWNER` commands in the dump file.\n- `-f` -\u003e output file or directory name\n- `-F c` -\u003e output file format (custom, directory, tar, plain text(default)). We are using the custom format here.\n- `-c` -\u003e clean(drop) database objects before recreating\n\nThe third goal, is to execute the dump once and have it at disposal for others in AWS S3.\n\n## Download the tool and install on your local machine or the remote server\n\nFor **Mac OSX** and **Linux/Unix** users the simplest method is to execute:\n\n```bash\ncurl -sSL https://raw.githubusercontent.com/manydesigns/dbdump/main/install.sh | bash\n```\n\nIt will download and extract the tool under `/usr/local/bin` path.\n\nFor **Windows users**:\n\nGo on the release page of the repository: https://github.com/ManyDesigns/dbdump/releases and select the correct architecture\nfor your Operating System.\n\nDownload it, decompress and save it in your Path.\n\n## How to use this cli\n\n### DUMP\n\nTo create a new dump you have to execute the following:\n\n1. Create a new environment variable `export AWS_BUCKET=\u003cname-of-the-bucket\u003e` where the dumps will be uploaded.\n2. The default AWS Region, if not specified is set to `eu-south-1`. So if the bucket has been created in another AWS\nregion, you have to create a new env variable: `export AWS_REGION=\u003cyour-region\u003e`\n3. Launch the command:\n\n```bash\ndbdump dump -W \u003cyour db password\u003e \\\n      -U \u003cyour db user\u003e \\\n\t\t\t-h \u003cyour DB server hostname/IP\u003e\n\t\t\t-p \u003cyour DB server port\u003e\n\t\t\t-d \u003cthe db name you want to dump\u003e\n```\nFor more options have a look at the help menu `dbdump dump --help`:\n\n```bash\ndbdump dump --help\nUsage of dump:\n-U string\nPostgreSQL user (default \"postgres\")\n-W string\nPostgreSQL password\n-a    Back up all non-template databases\n-d value\nSpecify a database to back up (can be used multiple times)\n-e string\nSpecify the target environment (e.g. prod|staging)getenv) (default \"staging\")\n-h string\nPostgreSQL host (default \"127.0.0.1\")\n-l    Avoid uploading the dump to a S3 bucket. Default is 'false'\n-p int\nPostgreSQL port (default 5432)\n-t string\nThe type of database to back up (e.g., postgres) (default \"postgres\")\n```\n\n### Restore\n\nThe `restore` sub-command works both using an S3 URI or a local file path\n\nIt works the same way as the `dump` sub-command but it has an option to speed-up the restore passing the number of CPU\ncores you want to use.\n\n```bash\ndbdump restore --help\nUsage of restore:\n-U string\nPostgreSQL user (default \"postgres\")\n-W string\nPostgreSQL password\n-d string\nName of the DB to restore (default \"eclaim\")\n-f string\nThe absolute path of the dump file to restore the DB from or the S3 URI\n-h string\nPostgreSQL host (default \"127.0.0.1\")\n-n int\nNumber of parallel processes (1 per CPU Core) to use (default 2)\n-p int\nPostgreSQL port (default 5432)\n-s    Download the dump from AWS S3 (default true)\n-t string\nThe type of database to restore (postgres,mysql,etc...) (default \"postgres\")\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanydesigns%2Fdbdump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanydesigns%2Fdbdump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanydesigns%2Fdbdump/lists"}