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?
Downloading a Google Cloud SQL Backup
Asked Answered
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.
Too scary to click on a backup and choose restore first. I didn't do it until I found this post, cause couldn't find the instance selection box hahaha :) –
Outline
This guide explains how you can restore to a different instance, I agree clicking restore is scary without knowing what it will do next. cloud.google.com/sql/docs/mysql/backup-recovery/restoring –
Fonsie
The restore button on the GCP panel will land you on another page to choose which instance before proceed. So don't worry and click on that "RESTORE" –
Boisleduc
I need to load the backup in a different instance in a different project. –
Kittiekittiwake
@AlanCabrera this is probably late, but there are instructions now: cloud.google.com/sql/docs/mysql/backup-recovery/…. You need to use the
sqladmin
API, but I have not had any luck yet as I keep getting "Service temporarily unavailable" errors, which is not very descriptive. –
Anaesthesiology © 2022 - 2024 — McMap. All rights reserved.