Reputation: 23
I connect to a SQL Server database within a google cloud instance by SQL Server Management Studio. When I do the backup of the database it gives me the path /var/opt/mssql/data/database_name.bak I can not change this.
First question: where to find this backup-file on google cloud?
Second question: how to configure the system that I can select another directory, for example a google cloud bucket?
Upvotes: 0
Views: 963
Reputation: 2053
That path will be within the instance's filesystem. I wouldn't try to interact with that filesystem directly when there's handy abstractions to help you do what you want here.
Backup and restore of SQL in the default method is actually a backup/restore of the compute instance it's running on. So it's not granular in terms of which databases or data you want saved nor is it good if you want the data somewhere else for disaster recovery.
Gcloud SQL export allows you to push a database out to a bucket or pull it to the local system.
e.g. gcloud sql export sql <INSTANCE> <URI>
Google provides a sqladmin API to call export operations much the same as the gcloud sql export command.
For example, you could periodically call that export operation from a Cloud Function and cron trigger to prepare for disaster scenarios.
Upvotes: 1