gpbackup and gprestore are Go utilities for performing backups and restores of a Greenplum Database. They are still currently in active development.
gpbackup requires Go version 1.8 or higher. Follow the directions here to get the language set up.
go get github.com/greenplum-db/gpbackup/...
This will place the code in
Building and installing binaries
cd into the gpbackup directory and run
make depend make build
This will put the gpbackup and gprestore binaries in
make build_linux and
make build_mac are for cross compiling between macOS and Linux
make install_helper will scp the gpbackup_helper binary (used with -single-data-file flag) to all hosts
Running the utilities
The basic command for gpbackup is
gpbackup --dbname <your_db_name>
The basic command for gprestore is
gprestore --timestamp <YYYYMMDDHHMMSS>
--help with either command for a complete list of options.
Validation and code quality
To run all tests except end-to-end (unit, integration, and linters), use
To run only unit tests, use
To run only integration tests (which require a running GPDB instance), use
To run end to end tests, use
We provide the following targets to help developers ensure their code fits Go standard formatting guidelines.
To run a linting tool that checks for basic coding errors, use
This target runs gometalinter.
Note: The lint target will fail if code is not formatted properly.
To automatically format your code and add/remove imports, use
To remove the compiled binaries and other generated files, run
The GitHub wiki for this project has several articles providing a more in-depth explanation of certain aspects of gpbackup and gprestore.
How to Contribute
We accept contributions via Github Pull requests only.
Follow the steps below to contribute to gpbackup:
- Fork the project’s repository.
go get github.com/greenplum-db/gpbackup/...and add your fork as a remote.
make dependto install required dependencies
- Create your own feature branch (e.g.
git checkout -b gpbackup_branch) and make changes on this branch.
make test, and
make end_to_endin your feature branch and ensure they are successful.
- Push your local branch to the fork (e.g.
git push <your_fork> gpbackup_branch) and submit a pull request.
Your contribution will be analyzed for product fit and engineering quality prior to merging. Note: All contributions must be sent using GitHub Pull Requests.
Your pull request is much more likely to be accepted if it is small and focused with a clear message that conveys the intent of your change.
Overall we follow GPDB's comprehensive contribution policy. Please refer to it here for details.