Downloading a Google Cloud SQL Backup - google-cloud-sql

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.

Related

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

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.

Database backup, only update not download the database again. PostgreSQL

I have one database. And daily have backup. The database postgreSQL. Now the backup every day download the whole database. But i like to only update the already backuped file ( only the changes add to the already downloaded database ) not download always the whola database again, again, again. That is possible? If yes how? If not, have any option to do different way?
I use PG-Admin. DBeaver 7.1.3.
Many thanks!

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.

Check if OrientDB is in backup mode/

We need to check in client app if OrientDB is creating backup.
Is there any way to check?
OrientDB supports backup and and restore operations, like any database management system.
The Backup can be performed by running the BACKUP DATABASE command. It's possible to automatize backups using the Automatic Backup server plugin, by modifying the
orientdb-server-config.xml
you should see the scheduled time in the server, like this one:
If you didn't modified the correct parameter in this file, you shouldn't have automatic backup enabled.
In case if you're using the Enterprise Edition you can check backup settings in the Server Management Area.
Hope it helps
Regards

TSQL syntax to restore .bak to new db

I need to automate the creation of a duplicate db from the .bak of my production db. I've done the operation plenty of times via the GUI but when executing from the commandline I'm a little confused by the various switches, in particular, the filenames and being sure ownership is correctly replicated.
Just looking for the TSQL syntax for RESTORE that accomplishes that.
Assuming you're using SQL Server 2005 or 2008, the simplest way is to use the "Script" button at the top of the restore database dialog in SQL Server Management Studio. This will automatically create a T-SQL script with all the options/settings configured in the way you've filled in the dialog.
look here: How to: Restore a Database to a New Location and Name (Transact-SQL), which has a good example:
This example creates a new database
named MyAdvWorks. MyAdvWorks is a
copy of the existing AdventureWorks
database that includes two files:
AdventureWorks_Data and
AdventureWorks_Log. This database uses
the simple recovery model. The
AdventureWorks database already
exists on the server instance, so the
files in the backup must be restored
to a new location. The RESTORE
FILELISTONLY statement is used to
determine the number and names of the
files in the database being restored.
The database backup is the first
backup set on the backup device.
USE master
GO
-- First determine the number and names of the files in the backup.
-- AdventureWorks_Backup is the name of the backup device.
RESTORE FILELISTONLY
FROM AdventureWorks_Backup
-- Restore the files for MyAdvWorks.
RESTORE DATABASE MyAdvWorks
FROM AdventureWorks_Backup
WITH RECOVERY,
MOVE 'AdventureWorks_Data' TO 'D:\MyData\MyAdvWorks_Data.mdf',
MOVE 'AdventureWorks_Log' TO 'F:\MyLog\MyAdvWorks_Log.ldf'
GO
This may help also: Copying Databases with Backup and Restore