GCP Cloud SQL - Instance restore

Getting your Trinity Audio player ready...
pt flag
en flag
es flag
Voiced by Amazon Polly

Imagine the following scenario:

In the cloud database universe, the need to restore backups can arise due to several reasons: human error, system failure, or even to create a test environment. Regardless of the reason, having a tool that simplifies this process is essential.

Although Google Cloud Platform (GCP) offers a robust and scalable solution with Cloud SQL, restoring backups can be a process that requires multiple steps and some familiarity with the platform. It was with this in mind that I developed the GCP Restore Tool.

Why Use the GCP Restore Tool?

The tool was designed with the goal of making the restoration process more user-friendly and less error-prone. With an intuitive graphical interface, you can select projects, instances, and the backup you want to restore with just a few clicks.

The biggest advantage? You don't have to be a GCP expert or handle complex commands. The tool takes care of everything for you.

How to Use the Tool

Install the GCP CLI

Open the terminal and type:

gcloud auth application-default login

You will be redirected to the authentication screen of the GCP console, authenticate.

Look at the terminal and it will have returned with some information about the location of the file

“application_default_credentials.json”

This file is what you must load through the “Load GCP Credentials” button

In the selection on the left, select the project and the source instance from the corresponding dropdown menus.

Click the “Load Backups” button and the tool will list all the available backups for the chosen instance.

In the section on the right, select the project and instance where you want to restore the backup.

After confirming your selection, click the “Restore” button. The tool will do all the heavy lifting for you, ensuring that the selected backup is restored to the chosen target instance.

This process only works by overwriting a pre-existing instance, so you need to create an instance in the destination project or understand that this activity will overwrite the target instance, make sure you have selected the right instance.

If everything works out, you will receive a message that the process has been sent to GCP, the entire process takes place in the background by GCP, so follow the portal to find out the status of the activity.

In the end, the restored instance will have the name, IP, etc. of the instance that it overwrote, but all the users, passwords, banks, specific settings, etc. of the original instance.

You can download and access the source code on GitHub.

ATTENTION!!!

The tool is being tested, so test it before running the operation in production.

Execute at your own risk.

Leave a Reply

Your email address will not be published. Required fields are marked *