Skip to content

Add gpBackMan — a backup management utility for Apache Cloudberry (Incubating) Backup.#79

Open
woblerr wants to merge 10 commits intoapache:mainfrom
woblerr:add_gpbackman
Open

Add gpBackMan — a backup management utility for Apache Cloudberry (Incubating) Backup.#79
woblerr wants to merge 10 commits intoapache:mainfrom
woblerr:add_gpbackman

Conversation

@woblerr
Copy link
Copy Markdown

@woblerr woblerr commented Mar 26, 2026

This PR adds gpBackMan, a utility for managing backups created by gpbackup. The tool provides an open-source alternative to the proprietary gpbackup_manager, addressing the need discussed in apache/cloudberry#1555

gpBackMan is based on the original gpbackman project (woblerr/gpbackman#39) and has been adapted for integration into the cloudberry-backup repository.

Motivation

The Apache Cloudberry community has expressed interest in having a backup management tool similar to gpbackup_manager, which is proprietary and not available in the open-source offering. gpBackMan fills this gap by providing essential backup management capabilities that work with the gpbackup_history.db SQLite history database format.

Features

gpBackMan provides the following functionality:

  • backup-info — display information about existing backups;
  • report-info — display the backup report for a specific backup;
  • backup-delete — delete a specific existing backup from local storage or using storage plugins;
  • backup-clean — delete all existing backups older than (or newer than) a specified time condition;
  • history-clean — clean deleted backups from the history database;

Both local storage and storage plugin-based backups are supported.

Related links

Discussion: apache/cloudberry#1555 — Availability of GPBackup_Manager in CB2.0
Issue: woblerr/gpbackman#39 — Support for Apache Cloudberry
Original project: gpbackman

woblerr added 10 commits March 15, 2026 23:10
Integrate gpbackman (https://github.com/woblerr/gpbackman) — a CLI utility for managing gpbackup backups — into the cloudberry-backup repo.
YAML functionality (history-migrate, converters, utils_file) is not ported.

Key changes:
- Add gpbackman.go entry point with //go:build gpbackman tag
- Create gpbackman/cmd/, gpbackman/gpbckpconfig/, gpbackman/textmsg/
- Migrate imports: greenplum-db/* → apache/cloudberry-*
- Remove converter layer — use history.BackupConfig directly
- Extract 11 BackupConfig methods into standalone functions (helpers.go)
- Replace go-pretty/v6 with olekukonko/tablewriter
- Add gpbackman to all Makefile targets (build/install/clean/package)
- Version via ldflags: -X gpbackman/cmd.version
- Rewrite unit tests from stdlib testing to Ginkgo/Gomega

CLI subcommands: backup-info, backup-delete, backup-clean, history-clean, report-info.
- Replace searchFilter() with utils.Exists() in gpbckpconfig/helpers.go
- Remove searchFilter() from gpbckpconfig/utils.go and its test
- Replace getCurrentTimestamp() with history.CurrentTimestamp() in cmd/backup_delete.go
- Remove getCurrentTimestamp() from cmd/wrappers.go and its test
@tuhaihe
Copy link
Copy Markdown
Member

tuhaihe commented Mar 27, 2026

Hi @woblerr thanks for your great work!

A license question needs your confirmation here: do you still want to keep these files under the original MIT license, or adopt the Apache license? (MIT files are allowed to be introduced in ASF projects.)

[WARNING] Files with unapproved licenses:
  end_to_end/gpbackman_test.go
  gpbackman.go
  gpbackman/cmd/constants.go
  gpbackman/cmd/interfaces.go
  gpbackman/cmd/backup_info.go
  gpbackman/cmd/backup_clean.go
  gpbackman/cmd/cmd_suite_test.go
  gpbackman/cmd/report_info.go
  gpbackman/cmd/wrappers_test.go
  gpbackman/cmd/history_clean.go
  gpbackman/cmd/root.go
  gpbackman/cmd/backup_delete.go
  gpbackman/cmd/wrappers.go
  gpbackman/README.md
  gpbackman/COMMANDS.md
  gpbackman/gpbckpconfig/utils_db.go
  gpbackman/gpbckpconfig/struct.go
  gpbackman/gpbckpconfig/utils_test.go
  gpbackman/gpbckpconfig/cluster.go

Once you confirm, I can help with it.

@tuhaihe tuhaihe requested review from robertmu and tuhaihe March 27, 2026 02:57
@woblerr
Copy link
Copy Markdown
Author

woblerr commented Mar 27, 2026

@tuhaihe
I agree to switch these files to the Apache 2.0 license.
It keeps licensing consistent across the entire cloudberry-backup repository.

The original gpbackman project will remain under MIT.
I plan to continue developing features there first and then port them to upstream (if these features will be useful for both projects), so the MIT → Apache 2.0 direction stays clean.

Is it acceptable for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants