whpg-backup provides the gpbackup and gprestore utilities. Build them from source, then install the binaries on every host in your WarehousePG cluster.
Prerequisites
- Build host: Go 1.23 or later, plus
sqlite3. Building directly on the WarehousePG coordinator avoids a cross-compile step, since it's already running the same OS as your segment hosts. If you build on a macOS workstation instead, usemake build_linuxto cross-compile for the cluster. - Every host in the cluster:
sqlite3.gpbackupsplits work between the coordinator and every segment host, so thesqlite3runtime dependency needs to be present wherevergpbackup,gprestore, orgpbackup_helperruns, not just on the build host.
Building from source
Clone the repository and change into it:
bashgit clone https://github.com/warehouse-pg/whpg-backup.git cd whpg-backupBuild the
gpbackup,gprestore, andgpbackup_helperbinaries:bashmake depend make buildThe binaries are placed in
$HOME/go/bin. If you're cross-compiling from a macOS workstation, runmake build_linuxinstead.
TIP
Add $HOME/go/bin to your PATH so you can run the binaries directly from the build host:
export PATH=$PATH:$HOME/go/binInstalling on the cluster
Confirm
sqlite3is installed on every host in the cluster, including the coordinator, standby coordinator, and all segment hosts. It's installed by default on many platforms, but install it if it's missing.On the coordinator, create a file
all_hostswhich lists all hosts in the WHPG cluster. For example:inicdw scdw sdw1 sdw2 sdw3Transfer the binaries to all hosts in the cluster and place them on
$PATH, for example in$GPHOME/bin. Use thegpsyncutility on WarehousePG 7, or thegpscputility on WarehousePG 6:WHPG 7
bashgpsync -f all_hosts $HOME/go/bin/gpbackup $HOME/go/bin/gprestore $HOME/go/bin/gpbackup_helper =:$GPHOME/binWHPG 6
bashgpscp -f all_hosts $HOME/go/bin/gpbackup $HOME/go/bin/gprestore $HOME/go/bin/gpbackup_helper =:$GPHOME/binVerify the installation by checking the
gpbackupandgprestoreversions:bashgpbackup --version gprestore --version
