Migrating SQL Server database from AWS to Azure - sql

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.

Related

SQL server to Azure process workflow migration

We are supporting a legacy system for our organisation. In the current scenario, we receive a SQL Server backup (.bak files) from the application vendor on an FTP location. For every weekend on Sunday it is a Full backup and for every other day its the differential one.
On our side, we have a SQL server instance running which has custom stored procedures written and scheduled to check the location every morning and then restore the backups every day. These restored backups are then used by the organisation for internal reporting purposes. There are 100s of other stored procedures written for different reports in different DBs on the same instance.
Since SQL Server 2008 is now out of support and for cost-saving purposes of running on-premise system, my team has been given a task to look into migrating this whole system to Azure SQL database.
My question is what is the most effective way in which we can move this workflow to the cloud? I have an azure trial account set up for me to try but haven't been successful in restoring the .bak files on Azure SQL instance.
Thanks.
You essentially have two options for Azure, either perform a fairly linear Lift and Shift to SQL Server on an Azure VM or go with a more advanced Azure PaaS offering in Azure SQL Database Managed Instance. The specific deployment Azure SQL Database (Single Instance) will not support your current solution requires with regard to the .bak file support, and I have detailed that below. For further details between the difference between Azure SQL Database Single Instance versus Managed Instance, please see: Features comparison: Azure SQL Database and Azure SQL Managed Instance
The second option, is to leverage the Azure Enterprise Ready Analytics Architecture (AERAA) (link) of Azure (PaaS) Analytics services. With Azure SQL Database (PaaS) services, as opposed to on-premise SQL Server or SQL Server on an Azure VM, there is no Integration Runtime or Analysis Services as a bundled service component. These services are separate PaaS offerings and with the help of the linked AERAA blog, you can gain a better understanding of the Azure Analytics services.
The .bak versus .bacpac support dilemma:
Since the main requirement for your solution is support of .bak files, you need to understand where .bak and where .bacpac files are supported. The term Azure SQL Database applies to both a specific deployment option for an Azure SQL database (PaaS) service and as a general term for Azure SQL cloud databases. As for the specific deployment option, Azure SQL Database (Single Instance nor Elastic Pools) will support your scenario with .bak files. This deployment option will support export/import functionality via .bacpac file format. It will not support full/partial restore functionality. The backup/restore functionality although configurable, is only in scope for the specific database hosted by an Azure SQL (logical) Server instance. Basically, you can not restore an external file. You can import, which is always a full copy. So, for that reason, for an Azure PaaS database service you will need Azure SQL Database Managed Instance for .bak file support or deploy an SQL Server VM image to an Azure VM, and migrate your objects via Azure Database Migration Service.
Regards,
Mike

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.

Backup and restore ENTIRE Azure SQL server (not individual DBs)

We use Azure as infrastructure for our app and its SQL DBs.
Currently Azure provides automatic backups for all tiers (Basic to Premium), but these settings are individual per DB.
How can I set backup for the entire server, with all DBs inside?
Actually, backups are configured on database level. When you backup all of your databases, the database server is considered backed up. More information on the topic: Azure SQL Database Backup and Restore

Team Foundation Server 2012 Update 2 - Scheduled Backups Wizard

After applying Update 2 - the Scheduled Backup is now a build-in feature (not requiring Power Tool). I have difficult understanding the required permissions required to dump a backup on a file-share. Even when trying to dump the backup on a local share - \mytfs2012server\c$\Backup - the wizard ends up with a:
TF401002: The SQL Server Database Engine failed to save the database backup to path... Please grant SQL service account read/write access to that folder.
The message is very simple. I have tried different things - without success. With Update 1 + Power Tools I succeeded to use the wizard after some tweaking. Anyone that can list the permissions required for the Scheduled Backup for Update 2?
Edit:
Update 3 did not change anything for me. However it looks like Update 4 will. From this page it looks like Update 4 will include changes regarding backup:
Scheduled Backups configuration is no longer blocked if the SQL Server service for TFS 2012 is running as a virtual account (for example: NT Service\MSSQLSERVER).
In TFS 2012 Update 2 and Update 3, transactional backups record a failure when they try to run while a full or differential backup is running.
Scheduled Backups no longer run transactional backups if a full or differential backup is running. Instead, the job will be suspended until the other backup has finished running.
I had the same Problem.
Infrastuctur: TFS 2012 Update 2, SQL Server 2012
Solution:
I created a simple shared Folder like \BACKUPSERVER\TFS_Backup$ on the DB Backup Server.
I configured the TFS admin and the SQL Admin with Full Control in the Security and Share Permissions.
Now the Backup Job is running.
But now i have an other Problem:
After running a Full Backup the Transaction-Logs were not truncated, does any one have the same Problem or maybe an solution?
Are you using virtual accounts for the server? Something like 'NT Service\MSSQLSERVER'? If so be aware that they aren't supported in the Scheduled Backups Wizard in both TFS 2012.2 & 2012.3.
You either have to create the backup plans manually or switch the SQL service account to a domain account or Network Service.
EDIT:
As per the comments, TFS 2012.4 RC2 and up has removed this restriction

SQL Azure Backups

Has anyone come up with a good way to do backups of SQL Azure databases?
The two approaches seem to be SSIS or BCP. SSIS looks like it requires a local install of MS SQL 2008 which I don't have. BCP looks a bit more promising but I haven't managed to find any examples of using it with SQL Azure as of yet.
At the PDC09 they announced SQL Azure Data Sync, which was an early preview that is designed to let you keep your local SQL Server in sync with an Azure SQL Server.
In terms of database backups for maintenance etc, then of course that is part of the service you pay for with Azure that MS manage.
The sync framework team have a blog on a number of issues surrounding data syncronisation between Azure and a local DB - http://blogs.msdn.com/sync/default.aspx
My personal favorite solution is to use Azure Mobile Services to do a nightly backup & export from SQL Azure to a .bacpac file hosted in Azure Storage. This solution doesn't require a 3rd party tool, no bcp or powershell, is 100% cloud and doesn't require a local hosted SQL Server instance to download/copy/backup anything.
There are about 8 different steps, but they're all pretty easy: http://geekswithblogs.net/BenBarreth/archive/2013/04/15/how-to-create-a-nightly-backup-of-your-sql-azure.aspx
SQL Azure now offers automated and schedulable backups to bacpac files in Azure blob storage
http://blogs.msdn.com/b/sql-bi-sap-cloud-crm_all_in_one_place/archive/2013/07/24/sql-azure-automated-database-export.aspx
We use this to make nightly backups and have the tool keep the most recent 14 backups.
Enzo Backup for SQL Azure is available (full release expected October 1st): http://www.bluesyntax.net/backup.aspx
You can backup a database with transactional consistency and restore it at a later time; it stores its backups in the cloud, or on-premise. It also includes a scheduling capability.
I spent some time with BCP and got it working acceptably. It's a bit annoying to have to do the backup/restore table-by-table but I'll script it and that will do until Microsoft bring in a proper SQL Azure backup feature which is supposedly going to be the first half of 2010.
Backup:
bcp mydb.dbo.customers out customers.dat -n -U user#azureserver -P pass -S tcp:azureserver.database.windows.net
Restore:
bcp mydb.dbo.customers in customers.dat -n -U user#azureserver -P pass -S tcp:azureserver.database.windows.net
We set up a simple solution using Red Gate tools, but it too requires a local SQL instance: http://mooneyblog.mmdbsolutions.com/index.php/2011/01/11/simple-database-backups-with-sql-azure
I'm using www.sqlscripter.com to generate insert/update data scripts (to sync my local db). Not for free (shareware) but worth to try.
You can now use SQL Azure Copy to perform backups of your database. More details on this can be found here.
Seems that azurelabs has something to offer now:
Azure Labs
related article