Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow restoration of Greenplum backups using a newer version of gpbackup #8

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ require (
golang.org/x/net v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
)
7 changes: 3 additions & 4 deletions report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/cloudberrydb/gp-common-go-libs/operating"
"github.com/cloudberrydb/gpbackup/history"
"github.com/cloudberrydb/gpbackup/utils"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
)

Expand Down Expand Up @@ -298,8 +297,8 @@ func EnsureBackupVersionCompatibility(backupVersion string, restoreVersion strin
restoreSemVer, err := semver.Make(restoreVersion)
gplog.FatalOnError(err)
if backupSemVer.GT(restoreSemVer) {
gplog.Fatal(errors.Errorf("gprestore %s cannot restore a backup taken with gpbackup %s; please use gprestore %s or later.",
restoreVersion, backupVersion, backupVersion), "")
gplog.Warn("gprestore %s cannot restore a backup taken with gpbackup %s; please use gprestore %s or later.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking, gpbackup is mainly used for database backup, not for upgrading, because different versions may have potential data compatibility issues.
If upgrading is needed, it is recommended to use other approaches.

Copy link
Author

@xanadu-dev xanadu-dev Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem I have is that I have not yet found any reference to "other approaches" for the greenplum to cloudberry transition and in my case this approach worked and enabled me to continue evaluation of cloudberry-db.

I can see why this PR cannot be accepted but the simplest solution I suggested earlier would be to change the versioning so that gpbackup could be used without any changes for importing greenplum data to cloudberry

One simple solution would be if the Cloudberry Gpbackup/Gprestore versioning started at version 2.X - then if trying to restore backup data from Greenplum to Cloudberry during a migration then checks would succeed as the Cloudberry version is later than the Greenplum version 1.X.

Even if the process is not fully supported then it provides a means of migration to CloudberryDB - without making such a change I cannot see any practical way of migrating and we will remain using Greenplum

Is this the recommended tool for migration ?
https://github.com/cloudberry-contrib/cbcopy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is suggested.

restoreVersion, backupVersion, backupVersion)
}
}

Expand All @@ -309,7 +308,7 @@ func EnsureDatabaseVersionCompatibility(backupGPDBVersion string, restoreGPDBVer
backupGPDBSemVer, err := semver.Make(threeDigitVersion)
gplog.FatalOnError(err)
if backupGPDBSemVer.Major > restoreGPDBVersion.SemVer.Major {
gplog.Fatal(errors.Errorf("Cannot restore from GPDB version %s to %s due to catalog incompatibilities.", backupGPDBVersion, restoreGPDBVersion.VersionString), "")
gplog.Warn("Cannot restore from GPDB version %s to %s due to catalog incompatibilities.", backupGPDBVersion, restoreGPDBVersion.VersionString)
}
}

Expand Down
Loading