How to backup (automatically) an azure sql database on a local server? - azure-sql-database

I am looking for a way to backup an azure sql database to a local server. The backup should be created automatically.
How can I do that?
Thanks in advance!

You can't use BACKUP - since Azure SQL Database is always a newer version than any other version of SQL Server that you can install.
The way to do this is to extract a BACPAC and then apply that to your local server
If you want the local copy to be updated regularly - but not continuously, AND the local copy does not get updated, then consider Azure Data Sync

Related

Upload .db file to Azure SQL

I have a .db file, with a bunch of tables and data (and a few one to many relationships), instead of rewriting everything, is there a way for me to just upload this database directly to Azure SQL?
My suggestion is to install SQL Server Developer Edition on your laptop or local computer and import those database files to that SQL instance as explained here, if they are Dbase files.
Once you have imported the .dbf files to the local SQL Server instance, use SQL Server Management Studio to deploy the database to Azure as shown here and here, or you can use Data Migration Assistant to migrate to Azure as explained here.

Remote SQL Server backups using Azure

I've got a handful of databases running on a SQL Server instance. I don't have access to be able to install the Azure Backup agent but I do have connection details and credentials to access the database and perform backups in SQL Server Management Studio.
What I want to do is be able to perform and schedule these backups and save them in to Azure Blob Storage. I could have this schedule running on my local computer but that's not an ideal solution.
I've got a powershell script that will perform this action for me but it relies on SQL Server assemblies to run. I've tried running this as a devops build task but am unable to do so without the assemblies it requires.
Does anybody know a way of setting this up? In azure for example? Is there a resource that will allow me to connect and backup a sql instance via connections string and save down to blob storage. Or an azure function perhaps?
Is there a resource that will allow me to connect and backup a sql instance via connections string and save down to blob storage?
I'm afraid the answer is no.
We can't find any API support in Azure to help you achieve that.
I think the SQL Server Management Studio and powershell script is more suitable for you.
Maybe you can think about using third-party tool SQL Backup and FTP, it can help you schedule backup the SQL Server to Azure Blob Storage.
Hope this helps.

How to restore SQL server database from external drive without uploading database to local hard disk?

I am running win7 on a VM. I have Microsoft SQL Server 2014 downloaded on the VM. I have an external drive with a .bak file that I wish to restore a database with. The database is 400+ GBs. My local disk cannot support a database of this size, but my external drive can. How do I run SQL Server locally and restore from and keep the database files externally?
You can create database then configure it for files run on external drive. Then try to restore it.
Creating db on another folder example here: Create a database using T SQL on a specified location
It's possible, search for DBCC TRACEOFF(1807), e. g.:
http://sql-articles.com/articles/general/day-2trace-flag-1807attach-network-data-file/

Migrating SQL Server database from AWS to Azure

I have a large database in an AWS instance running SQL Server 2008 on a Windows Server 2008 R2.
The database is constantly changing and writing information, and its size is about ~100GB
I wish to migrate from our Amazon services to Microsoft Azure.
But I cannot afford any lost of information more them for more than 20-30 minutes
I don't mind using the Azure SQL or running a SQL Server under a VM in Azure Cloud, but I must keep the databases live and updated, there are few main tables that information is being added to them constantly
What would be the best way to do so ?
if you are using an AWS instance and not RDS and you are going to an Azure instance and not "Azure SQL Database" you can use log-shipping or something similar to get the downtime down to a few seconds: http://msdn.microsoft.com/en-us/library/ms187103.aspx
The steps you need to take:
Take full backup on AWS
restore full backup without recovery on Azure
take log backup on AWS
restore log backup without recovery on Azure
repeat 3 and 4 until the time it takes is short enough (you probably want to script this out)
take app offline
take another log backup on AWS
restore that log backup WITH recovery on Azure
repoint App to Azure
bring App online again.
3, 4 and 5 is what log-shipping would automate, but you could just write a powershell script too.

Azure Bacpac file Restore Error

I do the daily bacpac file backup from Azure database using RedGate Azure Backup tool.
Until 31st of May, All my Bacpac files can restore to Local SQL2008R2 database using DAC Client Tool.
Starting from 1st of June, I got error like:
Failure Creating schema objects in database
'XXXXX' System.Data.SqlClient.SqlException (0x80131904): Cannot
find the object "dbo.XXXX" because it does not exist or you do not have per
missions.
When I check it table still exist in DB.Also No idea for this.
Is there anyone face that kind of missing table, invalid Column.. etc
RedGate Azure Backup is deprecated now. The DAC Client Tool (DacCli.exe) has been integrated into SSMS 2012 and SSDT. You could try updating your DAC Client Tool to the latest version (1.6 from 1.2)
SSMS 2012 Data Tools now allow you to Import Data-tier Applications. Take a look at the Data-Tier Application Framework Feature in SQL 2012 downloads. View this MSDN article for reference.
I use the free utility SQL Backup and FTP to backup Azure SQL Databases to a local .bacpac file. The free version allows you to backup up to 2 different databases and then the paid versions are very reasonable (i.e. Professional version is $70 or so).
http://sqlbackupandftp.com/
It actually runs on a schedule for me, automatically emails me the results of the backup and stores it on my Google Drive (even with the free version - I just have it store the timestamped backups in the file folder of my Google drive).
The procedure I use to restore it to a local database is:
Back up SQL Azure to .bacpac file
Login to local database server as sa
Right-click Databases
Click Import Data-Tier Application
Select .bacpac file either from Azure or local disk
Enter the name and the locations to store the data and log files
If necessary, set the original database to single user mode and delete it
If necessary, rename restored database to original database name
Note: Must use SQL Server 2012 (or later) management tools