Microsoft Azure backup VM database every hour - azure

I would like to have some help regarding this.. What I want to achieve is for my PostgreSQL installed on my docker-container in a VM to be backed-up every hour and that backup will be deleted for 2 hours.

I read about the microsoft blobs, and I think that's what I'm looking for but the question for now is.. How to transfer the backup of Postgresql database to the microsoft blob.. Is there a shell command for that?
I find this PostgreSQL-Backup tool provides a way to backup PostgreSQL, and it seems support backup PostgreSQL to Azure Storage, but this feature is not free.
Besides, even if you backup PostgreSQL to Azure Blob, currently Azure Blob storage does not provide auto-delete feature. You could try to mount the file share and use the basic feature (not be charged) that PostgreSQL-Backup tool provides to backup PostgreSQL to that file share, and then you could run a WebJob to detect backup files and dynamically&programmatically delete backup files.

Related

Azure Sql Database back up files

We are new to Azure SQL Database and doing some research about the backup files. I have few questions related to SQL Database.
1) I read that Azure has built-in backup capabilities. I don't see the back up files in the azure portal. We want to use the automated backup files and restore the database in our local environments. Is there any way to access the back up files.
2) I used the SQLPackage.exe command to export the database to my local machine. With this approach it is only allowing me to export a bacpac file. Is there anyway other way to take backup files with extension of .bak
The overall goal is to take a weekly full backup and daily differential backups, which would allow us to restore the database in local. Please suggest us the best options to do so.
Thanks in advance.
We want to use the automated backup files and restore the database in our local environments. Is there any way to access the back up files.
No, you cannot access the backup files directly. In SQL Sever you can't restore a backup file to an older version of SQL Server, and Azure SQL Database is generally newer than any SQL Server you could install. So you wouldn't be able to restore them anyway.
I read that Azure has built-in backup capabilities. I don't see the back up files in the azure portal. We want to use the automated backup files and restore the database in our local environments. Is there any way to access the back up files.
We can see the backup on Portal: SQL Server--> Manage Backups, but we can not access the backup files and use the automated backup files to restore the database in your local environments.
I used the SQLPackage.exe command to export the database to my local machine. With this approach it is only allowing me to export a bacpac file. Is there anyway other way to take backup files with extension of .bak
For Azure SQL Database, it doesn't provide a native way to generate '.bak' format backup file. You could reference:How to create BAK file from azure sql db.
About your goal, you should using some scripts to schedule backup the database to blob, then you can use the backup to restore the database in local.
Here two ways can help you:
Powershell scripts: Backup Azure SQL Databases to Blob storage: This Azure Automation runbook automates Azure SQL database backup to Blob storage and deletes old backups from blob storage.
Tool Database Backup Tool: SQLBackupAndFTP is SQL Server, MySQL
and PostgreSQL backup software that runs scheduled backups (full,
differential or transaction log) of SQL Server or SQL Server Express
databases (any version), runs file/folder backup, zips and encrypts
the backups, stores them on a network or on an FTP server or in the
cloud (Amazon S3 and others we're constantly adding more), removes
old backups, and sends an e-mail confirmation on the job's success
or failure.
Hope this helps.

Cannot see long-term backup files for Azure SQL

If I select to restore my Azure SQL database, I can choose from a large number of long-term backup files.
However, I just want to download those files locally.
I cannot see where I can access these files.
The Azure docs suggest that I click on the 'Manage Backups' link.
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-long-term-backup-retention-configure
I cannot see this link though.
Has anyone any idea where I can access these files?
You cannot restore those backup files to a local computer because this is a service managed by Azure.
What you can do is restore to a point-in-time which will create a new database, then export that database as bacpac to your local computer, and remove the newly created database once is no longer needed.
SqlPackage /Action:Export /SourceServerName:SampleSQLServer.sample.net,1433 /SourceDatabaseName:RestoredDatabase /TargetFile:"F:\Temp\RestoredDatabase.bacpac"

Migrate SQL Server database from Azure to AWS

I need to migrate a SQL Server database from Azure to AWS. I've tried to create a backup on Azure but it seems that option is not available, not even through a script.
I don't know if exists an option to backup in Azure, as you said. However, you can export your database to a .BACPAC file and import it in a local instance of SQL Server. Then you can create a .bak file from this database to export to the AWS.
To export your database to a bacpac file, you can follow this documentation:
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-export
You have at least a few options here:
You can indeed create a backup in Azure. The backup file will get stored in a Storage account you set up. You can then download this and transfer it to your AWS VM (or RDS services) and restore it. I believe the manual backup you create in Azure is in the form of a .BACPAC file, which is just a compressed backup file.
You can create an empty database in AWS, sync the two schemas using something like RedGate or SSDT (which is free) and then use SSIS to move the data over. Or you could use scripts if you wanted. This would be a better option if you wanted to move your data over piecemeal.
You can use features in SSMS to copy the database directly from Azure and directly to AWS. Personally though I've never had a great deal of luck moving databases like this.

Best practice to upgrade a SQL Azure DB?

I am trying to upgrade an Azure DB in a continuous release scenario. The DB lives in SQL Azure and its size keeps growing. Now it's about > 50G. In my previous on-premise experience, I usually backup the old DB in a compressed format and save it to an on-premise file sever. In case the upgrade fail, I can restore it safely.
But with SQL Azure, I am not sure if it's OK to download such a big DB from SQL Azure. And is there any best practice for the SQL Azure DB upgrade scenario?
ADD
I found this link regarding different SQL Azure backup strategies. But it'll be great if someone can share some field experiences.
Azure now has automatic exports (aka full backups) to blob storage that you can schedule. The .bacpac files are complete compressed copies of your database and blob storage is pretty cheap. To give you an idea of size we have a 20GB database that is backed up to only 500 MB. We typically keep 14 days of backups but how long to retain them is up to your needs.
It's kind of like the Ron Popeil Rotisserie. You just set it, and forget it.
Obviously after you take a backup you want to restore it somewhere else to verify it worked. It's also a good idea to periodically restore your backups to make sure they working over time. You can do all of this in the Azure Portal. Just create a new database based on a .bacpac file that you created from the automated export.
You actually don't have to download the DB on premise unless you want another copy locally. Because if you are using geo-redundant blob storage its already copied to another region and you have 6 copies in total. But again its up to you.
When you log into the management portal navigate to the Sql Database tab. Click on your DB and then click configure. There you can set up automated backups for your db to blob storage.
The path on the management portal looks like this:
https://manage.windowsazure.com/mycompany.com#Workspaces/SqlAzureExtension/SqlServer/coolazuredb/Database/5.coolazuredb/Config
Here is a screenshot of the automated export section:

Azure Backup Restore

I want to move an existing server 2008 instance from Rackspace/Hostway to Azure. Can I do a full OS/data backup, copy the backup file to the Azure server, and then restore from the backup file? How do you suggest me migrating this server to Azure? Hostway will not let me get a copy of the VMDK file.
Have you tried contacting the support for providing you with either VMDK or a VHD file? Why are you so sure they won't give it to you?
If they don't you could do a full system backup with either Windows Backup or any imaging software. Get that backup locally. Restore the backup locally on a virtual Machine. Run sysprep on that local VM. Get the VHD, upload it to Azure and finally create a Windows Azure VM from that VHD.
You can provision a SQL VM in the azure cloud and then synch your database to it directly or copy the database files directly to it. This has a vast performance improvement as well over the SQL Azure service and for a large business app with a lot of DB access we found that this is almost a requirement than an option. (DB should be on your C drive so that it runs on the local disk.) SQL Azure is slow because of how data is replicated, a local VM running the service is highly advised. We have an 11GB DB and this was the only way to get some reasonable performance out of it.
See https://stackoverflow.com/questions/2711868/azure-performance/13091125#13091125 for our benchmarks. I've done testing on SQL on VMS and it's on par with an on premises solution.

Resources