PITR recovery fails when there are no transactions (pgbackrest)

Prolem

You are trying to do PITR recovery for a specific time, but the restore fails with something similar to the following message

FATAL:  recovery ended before configured recovery target was reached

Solution

This seems to be caused by a feature/bug that causes this error when there are no transactions between the backups, as explained in more detail here

Downloading gitlab database backup from s3

You want to download a copy of your gitlab backup (ie when upgrading to version 7.0.0 as described in [here](https://docs.gitlab.com/charts/installation/database_upgrade.html#steps-for-upgrading-the-bundled-postgresql) ).

Login to the toolbox pod and get the credentials file for s3

cat /etc/gitlab/.s3cfg

Create a new file locally (ie ~/.s3cfg_gitlab) and then download the file locally with

s3cmd get s3://gitlab-backups/database_upgrade_6_gitlab_backup.tar  20230531_gitlab_backup.tar -c ~/.s3cfg_gitlab