How to Automate On-Premises to Azure SQL Database Data Export? - azure

I have 5 SQL Servers where there is an average of 200 Databases on each of them, how can I go about exporting all of these databases to azure and create the SQL Databases with the same name in azure as well.
This Can be done using azure automation account feature the DSC Configurations?
Can someone tell me or point me in the right direction for this??

Azure Database Migration Service can really help you in this case. Locate the service on Azure portal and create a "Migration Service" for each database server. It will ask you for subscription, resource group, VNET, location and pricing tier. For the pricing tier choose Basic if you intend to migrate small and medium tier sizes. In your case, use "General Purpose". Take advantage that SKU choices of database migration service are currently in preview.
Once you have created the project you can click on it and the following Migration Wizard will appear. Provide the name of the on-premise database server on step #1. On Step #2 select all 200 databases on the server, On Step #3 select the target. On Step #4 you will have to provide a SMB network share that Migration service will use to take backups of the on-premises database.
Once you finished the wizard you can follow the progress on the migration project as shown below.

Related

Azure Migrate for VM and database

I am trying to use Azure Migrate to move a VM and database from Openstack based cloud to Azure as a VM and managed database. What will happen after the migration is complete ? Will Azure Migrate automatically remove the VM and the database from the source infrastructure ? Are the source resources retained as they are so that the migration can be cancelled if needed?
You have to clean up the resource on Openstack on your own:
Database - Migrate your data with Database Migration Service
Migrate your data with Database Migration Service
In the Azure portal, follow these steps to create an instance of Azure Database Migration Service, and then to run it to migrate the data in your databases:
Create an instance of Azure Database Migration Service. Choose the pricing tier based on whether you need an online or offline migration.
Create a new migration project. Choose the type of migration you want to perform, either offline or online.
Specify source and target server details, including the authentication information.
Identify the databases. Map the relevant target database on the target server to the source server.
Run and monitor the migration.
Select the Run migration button to start the migration. The migration activity screen will appear.
Track the progress until the process shows as completed.
After all the required databases are migrated, check them to make sure they're working.
When these steps are complete, your schema and data have been migrated to the Azure SQL Database instance. You can then shut down and decommission your on-premises databases and servers.
VM - Post-migration steps:
After the migration has taken place, review the security settings of the virtual machine after the migration. Restrict network access for unused services by using network security groups. Deploy Azure Disk Encryption to secure the disks from data theft and unauthorized access.
Consider improving the resilience of the migrated machines by:
Adding a backup schedule that uses Azure Backup.
Replicating the machines to a secondary region using Azure Site Recovery.
Complete clean-up tasks for the remaining on-premises servers. Such tasks may include removing the servers from local backups and removing their raw disk files from storage-area network (SAN) storage to free up space. Update documentation related to the migrated servers to reflect their new IP addresses and locations in Azure.

How to Synapse Pool/DW in Terraform without entire synapse workspace

I am attempting to spin up an azure synapse pool in terraform. At present from the documentation found at: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/synapse_sql_pool, it appears you have to use a synapse workspace, which also includes a datafactory integration and powerbi, etc.
Right now we just want to datawarehouse not all the other bells and whistles. As you can see within the Azure Portal, you are free to spin up a synapse analytics DW with or without a workspace (see the right image in the box, "formerly SQL DW"):
When you spin that up, you simply have a standalone DW...
Any insight on just getting the datawarehouse as you can in the portal without the workspace and realted?
I am not a Terraform guy. As for Synapse, you are referring to the new one that is in preview. The new one has the workspace which supports SQL pools, Sparks clusters and Pipelines. Although they are supported, they are not created when you deploy a Synapse workspace.
So you can go ahead and created the workspace and one SQL Pool and you will get what you're looking for: the data warehouse engine, named SQL Pool.
Some extra notes: there are 2 types of SQL data warehouse in Synapse Analytics: SQL Pools and SQL on demand. The first one is provisioned computing and is the traditional one with all the features. SQL on demand is still in preview, doesn't have all the features and is charged by the terabyte processed by your queries.
Happy data crunching!

Azure SQL Deleted Database cannot restore because of region restriction

Is there any way to change the region for a Azure SQL server/database from one geographical region to another region?
I have a deleted database which I cannot restore as I get "MSDN subscriptions are restricted from provisioning in this region. Please choose a different region. For exceptions to this rule please contact Microsoft Support."
The Server was originally setup in US-West region with a VS MSDN Subscription.
To answer the ways to change region from Azure SQL database, there are mutiple options -
Configure active geo-replication for Azure SQL Database in the Azure portal and initiate failover
Copy an Azure SQL database
Export an Azure SQL database to a BACPAC file
Set up SQL Data Sync (Preview)
However, based on the error if there is limitation on specific region and you have strict requirement to have database in same region you may need to work with Azure support on it.

AZURE SQL Database vs SQL Server

I have a "pay as you go" Azure subscription. I am trying to keep costs down.... Do I need the resource "SQL Server" when using the SQL database resource? As I read all the supporting documents SQL Server will be used on Azure VMs to extend on-premises SQL Server. I am not doing this, I am hosting a web application on the Cloud services (Classic) resource that is connecting to the Azure SQL database.
Thanks for the help!
Azure SQL Database gives you most of the functionalities of a "Standard" SQL Server database and is (in most cases) the choise with the lower costs.
It also provides you a set of additional functionalities (some of them needs to be enabled first or are part of the higher service tiers) like an out of the box 3-node failover cluster, geo-redundancy, automated backups, etc.
If you need additional SQL Server features like SQL Server Analysis Services, which are not part of Azure SQL DB or aren't provided as another Azure service, you need to create a Virtual Maschine with a real SQL Server installed.
The "SQL Server", which is hosting your Azure SQL DB, is just a wrapper and provides you only minimal features like user and role management or your firewall settings.
If your application is connecting only to Azure SQL database and using its features, you don't need SQL Server license. You just need to have the Azure subscription and pay for the SQL database(s) that you are using. However when you create an Azure SQL database, it will prompt you to create a "Server" resource which acts as a logical group for all of your SQL databases that you create within that "server". This server is NOT charged separately and just provides a logical grouping as well as a common connection point for your SQL databases. Your billing is always based on the SQL Database(s) that you create and use.
hope this helps.
Srini Acharya

How can i change sql azure server location

I would like to transfer my existing SQL Azure location to other one, but I think there is no functionality right now to do so on the management portal of Azure.
I just googled it and found one link http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/e6c961cc-5eea-4f07-82c9-a8805d367b05 that says I need to use the data sync option in Azure's portal but I don't have that feature enabled in my Azure portal.
Also if I do use that option, is there any charge for it? Finally, are there any other option that is possible for moving the SQL Azure location?
To Move an Existing SQL Server Database to a New Region on Azure Assuming There Are No Blob Containers Associated With the Database. For further reference see:
https://azure.microsoft.com/en-us/blog/migrating-azure-services-to-new-regions/
Upgrade the database, if necessary, to one of the Premium pricing tiers
Add geo-replication to the existing database. You can choose what region to have the backup of the existing database. Create a new Database server in the target region of your choice. I suggest provisioning that new database server with the same admin username and password as the existing sql database. When creating the secondary database, I suggest making the Secondary type “Readable” as it will allow you the ability to check that all data and schemas were replicated correctly.
Allow the two databases time to sync. Rule of thumb according from Microsoft AzureCAT is: 3 * (5 minutes + database size / 150 MB/minute)
Configure the Firewall settings of the secondary database to allow the necessary IP addresses to access the database
Temporarily shut down whatever users or applications are accessing the existing database.
From the Azure portal select the existing database and change its geo-replication role from primary to secondary.
Run any ddl scripts that rely on the masterdb such as ddl scripts to recreate users and user profiles
Change the connection strings of any applications to point to the new database.
Users and applications can now connect to the new Database
At your discretion you can remove the old database as a backup and add any new regions as backup.
In terms of charges there will be charges for upgrading the old database if it isn't already a premium database. There will also be charges for creating the geo-replicated database. However, those charges can be limited to a day to a few days worth of fees (depending on how long geo-replication takes). Once the new database is up and running, delete the old database as soon as possible to limit additional fees. Finally, if you upgraded the service level of the old database to a premium tier to facilitate the geo-replication, you will want to downgrade the new database to the original service level of the old database to also limit fees.
I think you can use new Import/Export bacpac feature. I have used it to move databases between accounts and can't see why it wouldn't also work between regions.
See how here
If you are able to stop writes to the DB for a time then you can use the Copy feature on the Azure Portal.
Create a new SQL Server in the region of your choosing.
Add your service(s) IP addresses to the new SQL Server firewall.
Stop writes to the origin database.
Open the origin database in the Azure Portal and click Copy at the top of the blade.
Choose your new SQL server located in the destination region.
Wait for the copy to complete.
Update your service(s) to point to the destination DB.
Enable DB writes.
Verify everything is working.
Delete origin database (and server if it was the only DB on the server).
I wouldn't use DataSynch because it creates many objects in your database to perform synchronization (it's an invasive solution). You can indeed try the Import/Export feature; that should work fine. You can also download a trial version of the Enzo backup tool, which comes with a 30-day free trial: http://www.bluesyntax.net/backup.aspx. [disclaimer: I am the author of this tool]
Regarding the pricing question, you may be charged for data being extracted out of the database. Moving data "in" SQL Azure is free of charge for now. If you are transferring the data to a different data center, you will be charged for extracting the data. It's 15 cents per GB in the US and Europe, and 20 cents in Asia. Here are the pricing details: http://www.microsoft.com/windowsazure/pricing/
Keep in mind that a database that requires 4GB of storage doesn't mean you have 4GB of data. Sometimes indexes can take a lot of space. To estimate the size of the data you will need to transfer you can either drop your indexes (and wait a little for the database size to shrink; the database size should be roughly equal to your data transfer needs) or you can calculate the size of your tables by running a command. Here is a link to an article that shows how to do something similar (look at the second command with is a SELECT statement; just run it for all the tables): http://www.sqldocumentor.com/table-size-in-sql-server-find-rows-and-disk-space-usage
Azure has released a new tool called Azure Resource Mover.
Resource mover can for now handle these resources:
Azure VMs and associated disks
NICs
Availability sets
Azure virtual networks
Public IP addresses
Network security groups (NSGs)
Internal and public load balancers
Azure SQL databases and elastic pools
https://learn.microsoft.com/en-us/azure/resource-mover/move-region-within-resource-group
Azure SQL Server is not supported yet but Azure has a complete guide for this anyway:
https://learn.microsoft.com/en-us/azure/resource-mover/tutorial-move-region-sql#move-the-sql-server

Resources