GCP Cloud SQL (PostgreSQL) Backups remain after deleting the isntance - postgresql

We have recently started using GCP Cloud SQL, and have been testing backup and restores. We have done the following and seem to have backups that are not associated with an instance, and we can't remove them.
We created a database and have started using it.
We created a backup schedule for the database backup and wanted to test the restoration process.
We created a clone of the database, and then tested a restore from the original backup. This was all fine and worked as expected.
We left the clone running for a few days, then decided that it was not needed anymore.
We deleted the clone, but by this point, it had created a few backups.
If we run the
gcloud sql backups list --instance -
It shows all backups, including 3 from the deleted instance, this is strange, as backups are supposed to be removed when the instance is deleted (if they are automated). If try to run
gcloud sql backups delete [ID]
I get a http403 error saying not authorized (I am a GCP admin, so have all permissions)
We have tried re-creating the instance with the same name, but the backups are presumably linked via an ID, not name.
Does anyone know:
a) Will we be changed for this?
b) Is there a way to delete these
c) it may well be a legitimate scenario to want to keep backups, and may be restore them later. the restoration process does not work for these orphaned backups, we have tried
d) I found this post, does anyone know if Google have progressed this?
Any help on this would be much appreciated.

Related

How to Backup Postgres Database on AWS and restore locally?

I'm working on trying to setup my local database with some mock data to work with. We have a development AWS account with a postgres database. I would like to create a backup of it, export it to my local computer, and restore to my local postgres database.
I've been trying to find how to do this online, but everything I'm finding is on how to backup to AWS and to restore back to AWS. I tried creating a snapshot and exporting it via S3 - but the snapshot doesn't produce a sql file to restore from like I was expecting.
If anyone can point me in the right direction I would very much appreciate it :)
I am afraid that the only chance you have is pg_dump/pg_restore.
Even if Amazon lets you get your hands on its file system backups, which I doubt, they may be of little use to you, since Amazon runs modified versions of PostgreSQL and you cannot be sure that the physical file format is identical to PostgreSQL.

Heroku Postgres pg:backups Restore From Copy

I suspect I already know the answer here, but wanted to confirm. When you use the command line interface for Postgres backups, the command heroku pg:backups returns a list of Backups, Restores, and Copies. Apparently, my daily backups routine stopped working somewhere along the way, so my backups list was empty. I did, however, see this:
My suspicion is that this is merely a historical record showing that a copy was performed, however, I was hopeful that maybe I would be able to recover the database from that point in time. The restore command doesn't work with that ID, though. It gives me:
Can anyone confirm that this copy can or cannot be recovered?

Downloading a Google Cloud SQL Backup

I'm running an instance of Google Cloud SQL. A CMS connects to this and updates it. Then there are several replications that run websites. Someone using the CMS deleted a page by accident. There's a backup from 12 hours ago, but I don't want to restore to that backup because the replications will be off with all the other changes that have been made. I just want to grab the SQL dump of that backup so I can scrounge out one page and restore that content. But, I don't see any way to do this, the only options in the Google Cloud SQL Console are to Delete or Restore a backup. Is there any way to download a backup?
You can restore the backup to a different instance. Create a new instance with the same database version, then click restore on the old instance backup and pick the new instance as the target. Once the restore is complete, you can connect to the new instance and retrieve the content you are interested in.

Where are the snapshots of a db in Heroku?

So far, I could see my auto-created snapshots from the PG Backup and the manually created, under the Postgres - > Databases -> Snapshots.
Now, instead of my snapshots, I only see this message:
Snapshots are archives of an entire database stored in a single file. Snapshots can be used to create an archive of the history of your database for compliance or reference.
Where have they gone?
After the ticket I sent to heroku, they fixed it in few hours! Obviously, by mistake they disappeared.

How to salvage data from Heroku Postgres

we are using Heroku Postgres with Ruby on Rails 3.2.
A few days before, we deleted important data by mistake using 'heroku run db:load' with misconfigured data.yml, that is, drop tables and the recreate tables with almost no data.
Backup data is only available 2 weeeks before, so we lost data of 2 weeks.
So We need to recover not by PG Backup/pg_dump but by postgresql's system data files.
I think, the only way to recover data is to restore data from xlog or archive file, but of course we don't have permission to be Super User/Replication Role to copy postgres database on heroku (or Amazon EC2) to local server.
Is there anyone who confronted such a case and resolved the problem?
Your only option is the backups provided by the PgBackups service (if you had that running). If not, Heroku support might have more options available.
At a minimum, you will have some data loss, but you can guarantee you won't do it again ;)