From 0467a72e85fbbdb6a0027c2653a28fe21af04085 Mon Sep 17 00:00:00 2001 From: Muthu Chidambaram Date: Wed, 11 Oct 2023 23:15:43 +0000 Subject: [PATCH] [PLAT-10806] Searching custom path for active software Summary: Issue with replicated to YBA-installer migration where searching for the version failed because we had a custom install root and we had previously hardcoded /opt/yugabyte. This diff uses the argument data_dir (which in the YBA-installer case is the BaseInstall/installRoot) when finding the realpath of the active directory. Test Plan: Run backup/restore with custom install root. Reviewers: dshubin, sanketh Reviewed By: dshubin Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D29227 --- managed/devops/bin/yb_platform_backup.sh | 2 +- managed/yba-installer/cmd/backup.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/managed/devops/bin/yb_platform_backup.sh b/managed/devops/bin/yb_platform_backup.sh index cc55340ae5cd..9ac6d575a1d6 100755 --- a/managed/devops/bin/yb_platform_backup.sh +++ b/managed/devops/bin/yb_platform_backup.sh @@ -482,7 +482,7 @@ restore_backup() { metadata_regex="**/yugaware/conf/${VERSION_METADATA}" if [[ "${yba_installer}" = true ]]; then - version=$(basename $(realpath /opt/yugabyte/software/active)) + version=$(basename $(realpath ${data_dir}/software/active)) metadata_regex="**/${version}/**/yugaware/conf/${VERSION_METADATA}" fi current_metadata_path=$(find ${destination} -wholename ${metadata_regex}) diff --git a/managed/yba-installer/cmd/backup.go b/managed/yba-installer/cmd/backup.go index 4a7523270d07..6ec2c557b384 100644 --- a/managed/yba-installer/cmd/backup.go +++ b/managed/yba-installer/cmd/backup.go @@ -115,6 +115,8 @@ func RestoreBackupScript(inputPath string, destination string, skipRestart bool, } if migration { args = append(args, "--migration") + // Disable version checking in case of version upgrades during migration. + args = append(args, "--disable_version_check") } if useSystemPostgres { args = append(args, "--use_system_pg")