How to backup MySQL databases on Google Cloud SQL Platform?
Article ID
20005
Description
Please use the following steps to backup MySQL databases using AhsayOBM on Google Cloud SQL.
Create backup set
- Login to your OBM user account via the AhsayCBS web management console.
- Go to User.
- Open Backup Sets.
- Click the [+] sign to create a new backup set.
- To proceed, check the names of the databases you aim to backup first (You may use a utility like MySQL Workbench).
- Ater confirming the databases, go back to your AhsayCBS web management console.
- Change the backup set type to MySQL Backup.
- Rename the file backup set.
- Select Linux for platform.
- Enter the login ID and password, followed by the host of the machine used.
- You may keep the Port value on default or change it accordingly if your MySQL database instance is setup using a different port.
- Before entering the path for mysqldump, make sure that the MySQL version on the Google Cloud SQL matches the version installed on the backup machine you're using.
- Under Other selected source, click the [+] button to add a backup source.
- Manually enter the directory path of each database you intent to backup. Click the [+] to continue.
- Repeat the same step if you intend to add other sources as well.
- Click Next to continue.
- Enter the host name to use the computer name for the scheduler.
- You may use the default schedule provided or create a new one.
- Click Next.
- Click the [+] button to add a new storage destination and select Ahsay Drive.
- Click the [+] button again.
- Leave the backup mode on Sequential.
- Click Save.
Configure the settings before running backup job
- Click on the backup set.
- Recommended: Open Retention Policy and enable Simple retention policy for 30 days.
- Click Others and configure the Temporary Directory.
- Leave Compressions on default. Encryption key will be set up on Linux CLI.
- Scroll down and enable File Viewer.
- Click Save.
Set up the encryption key
- Login as root to the Linux backup machine using an SSH client.
- Use the cd command to go to bin: cd /usr/local/obm/bin
- Open AhsayOBM to setup the encryption key: sh RunConfigurator.sh
- Enter 1 to login.
- Enter the login name and password.
- Enter Y to setup the encryption key of your backup set.
- Enter Y again to confirm.
- Enter 1 to select Default.
- Enter 8 to quit
Run the backup job
- Use the sh command to run the backup job: sh RunBackupSet.sh '[backup set name]'
- After the backup job, a line will indicate Backup Completed Successfully.
Check the backed up databases from File Viewer
- Open File Viewer and reload the page.
- Select the backup set.
- Click on the MySQL folder to see all the databases backed up.