karina icon indicating copy to clipboard operation
karina copied to clipboard

karina db restore cannot migrate backups

Open BrendanGalloway opened this issue 3 years ago • 0 comments

WARN[0000] Using mapstructure to decode OperatorConfiguration: unrecognized type: int64
INFO[0000] Restoring postgres-operator/postgres-harbor[version=12, secret=postgres.postgres-harbor.credentials] from postgres-backups-A/harbor/2020-03-08.172436.sql.gz
INFO[0000] pods//backup-postgres-harbor-155-121259 created
[backup-postgres-harbor-155-121259] + IFS='
[backup-postgres-harbor-155-121259] 	'
[backup-postgres-harbor-155-121259] + PG_BIN=/usr/lib/postgresql/12/bin
[backup-postgres-harbor-155-121259] + args=()
[backup-postgres-harbor-155-121259] + [[ ! -z https://xxxxxxxx ]]
[backup-postgres-harbor-155-121259] + args+=("--endpoint-url=$LOGICAL_BACKUP_S3_ENDPOINT")
[backup-postgres-harbor-155-121259] + [[ ! -z xxxxxxx ]]
[backup-postgres-harbor-155-121259] + args+=("--region=$LOGICAL_BACKUP_S3_REGION")
[backup-postgres-harbor-155-121259] + [[ ! -z AES256 ]]
[backup-postgres-harbor-155-121259] + args+=("--sse=$LOGICAL_BACKUP_S3_SSE")
[backup-postgres-harbor-155-121259] + aws s3 cp s3://postgres-backups-B/postgres-backups-A/harbor/2020-03-08.172436.sql.gz - --endpoint-url=https://xxxxxxxx --region=xxxxx --sse=AES256
[backup-postgres-harbor-155-121259] + gzip -d
[backup-postgres-harbor-155-121259] download failed: s3://postgres-backups-B/postgres-backups-A/harbor/2020-03-08.172436.sql.gz to - An error occurred (404) when calling the HeadObject operation: Not Found
[backup-postgres-harbor-155-121259]
[backup-postgres-harbor-155-121259] gzip: stdin: unexpected end of file
FATA[0005] Error Restore up db pod did not finish successfully Failed -

The restore.sh script used to perform the db backup task hardcodes the bucket location. Because of this, the restore cannot be used to migrate an existing DB to a new postgresql instance without manually copying the backup file between buckets

BrendanGalloway avatar Apr 16 '21 10:04 BrendanGalloway