Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gcloud sql backups restore 1504554300110 --restore-instance=[MY-DB-INSTANCE]
- ERROR: (gcloud.sql.backups.restore) HTTPError 503: Service temporarily unavailable.
- gcloud sql backups restore [BACKUP_ID] --restore-instance=[INSTANCE_NAME]
- gcloud sql backups restore [BACKUP_ID] --restore-instance=[TARGET_INSTANCE_NAME]
- --backup-instance=[SOURCE_INSTANCE_NAME]
- gcloud sql backups list --instance [INSTANCE_NAME]
- echo "Getting Access Token"
- ACCESS_TOKEN="$(gcloud auth print-access-token)"
- echo "List available backups for the instance [INSTANCE_NAME] in [PROJECT_ID]"
- curl --header "Authorization: Bearer ${ACCESS_TOKEN}"
- -X GET
- https://www.googleapis.com/sql/v1beta4/projects/[PROJECT_ID]/instances/[INSTANCE_NAME]/backupRuns
- echo "Restore backup [BACKUP_ID] in instance [INSTANCE_NAME] in [PROJECT_ID]"
- curl --header "Authorization: Bearer ${ACCESS_TOKEN}"
- --header 'Content-Type: application/json'
- --data '{ "restoreBackupContext": {"backupRunId": "[BACKUP_ID]"}}'
- -X POST
- https://www.googleapis.com/sql/v1beta4/projects/[PROJECT-ID]/instances/[INSTANCE_NAME]/restoreBackup
Add Comment
Please, Sign In to add comment