Azure sql. data and structure migration road map


Published on

Microsoft describes Azure SQL as an ordinary MS SQL Server hosted in the cloud. If it’s true, all the functionality of the standalone MS SQL Server should be available on Azure SQL. Let’s investigate the functionality of Azure SQL based on the first task which should be solved on the Cloud Project Lifecycle.

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Azure sql. data and structure migration road map

  1. 1. ©2012 by EliNext GroupAzure SQL. Data and Structure Migration Road MapMicrosoft describesAzure SQL as anordinary MS SQL Serverhosted in the cloud. Ifit’s true, all thefunctionality of thestandalone MS SQL Server should be available on AzureSQL. Let’s investigate the functionality of Azure SQL basedon the first task which should be solved on the Cloud ProjectLifecycle. We’ll make an assumption, that we already have astandalone application that will be migrated to the cloud. Andwe have a database (we will describe the methods ofmigration of database structure and database with dataseparately) and we need to move it to the cloud server.When we discussed this problem in our developers’ team, all of us
  2. 2. ©2012 by EliNext Grouphad the same vision of data migration (which is available in a usualMS SQL Server). We make a backup of our local database, uploadthis file using the cloud management console and restore the databasefrom file to Azure SQL Server. But our dreams were not brought tolife by Microsoft. There is no possibility of database restoring fromfile in the Azure Server Management console. So we had to find theother workflow to tire up our project database on the cloud SQLServer.
  3. 3. ©2012 by EliNext Group
  4. 4. ©2012 by EliNext GroupThe next method of data movement that we’ve tried was databasestructure serializing to SQL initial script:1. First of all we create an SQL Script using the Object explorer >>Database >> Tasks >> Generate Script
  5. 5. ©2012 by EliNext Group 2. Create new database on the Azure server3. Run the script, using Azure Management Portal and …
  6. 6. ©2012 by EliNext Groupget a lot of errors like: ‘Keyword or statement option pad_indexis not supported in this version of SQL Server’.We deleted the first part of them and got another list of errors. Afterthat we finally found full Azure SQL Specification on the MSDN: you can see from the link, there are a lot of functions that arepartially supported or not supported at all. You should manuallychange the initial SQL Script to fit SQL Azure Syntax before applyingit.So we’ve continued searching for an easier way to move databasestructure and data for local MS SQL Server to Azure SQL.
  7. 7. ©2012 by EliNext GroupIn the Azure Server documentation, I’ve found information about theData Tier Application (DAC). It is an application that could beextracted from the real database structure (or constructed using VisualStudio), uploaded to Azure BLOB Storage and imported to AzureSQL. Full Specification of Data Tier Application you can find inMSDN: we have tried to create the Data Tier Application using VisualStudio. There were few errors that were easy to fix. And the Data TierApplication was build successfully.Another way to create it is to use SQL Server Management Studio2008 R2. You could easily extract DAC package using a simpleexport wizard.
  8. 8. ©2012 by EliNext GroupAfter creating the DAC there is a problem with uploading files toAzure Storage. Azure Storage doesn’t have an upload form for files.To do this we’ve used Windows Azure Platform Management Toolthat could be downloaded from Codeplex:http://wapmmc.codeplex.comWindows Azure 1.4 SDK is a prerequirement for it. DAC Package Upload you should create DAC Import Task. Fillthe data to the form and …
  9. 9. ©2012 by EliNext Groupview the status of DAC import on the status screen. As you can see,both Visual Studio 2010 and MS SQL Management Studio 2008 R2DAC Packages import failed because of the DAC file format.
  10. 10. ©2012 by EliNext GroupFinally and unexpectedly the easiest solution for database structuredeployment was found:1. You should login to the Azure SQL Server Management Consolewithout specifying the Database Name2. Choose the Deploy Data Tier Application option3. Select the DAC package from the local disk (no need to upload it
  11. 11. ©2012 by EliNext Groupto the storage!)4. Choose the database name and other options5. Click Submit and in a few moments you’ll get the database youneed on Azure ServerWARNING: We got good results only with the DAC made on MSSQL Server 2008R2. Visual Studio DAC file gave us a syntax
  12. 12. ©2012 by EliNext Grouperror on import.So we have an empty database and we need to move data to it.The first possibility of data migration we’ve found is SQL ServerIntegration Services (SSIS). Using a visual development tool basedon Microsoft Visual Studio called the SQL Server BusinessIntelligence Development Studio (BIDS). It allows users to edit SSISpackages using drag-and-drop user interface.
  13. 13. ©2012 by EliNext GroupIt is a very easy to use tool, but we’ve got a problem using it. Thetarget database (on Azure SQL Server) should not have the primarykeys set on the tables, because data is migrated using all the columns.And in case of migration to table which has a primary key set we willget the Primary Key Violation Error. So this way of migration isgood, but not ideal.Here are some other variants: • Use a third party tool to create the SQL script with INERT Statements and run it on the Azure SQL side. However, you might experience problems with blog, image fields, etc. Also take into account the large size of the script in case of huge amount of data .
  14. 14. ©2012 by EliNext Group • Write a custom Data Migration Tool. We could easily connect to the remote Azure SQL and push the data to it from our application. • You could also use Data Export/Import Tool from the Management Studio. But there is also a problem. You cannot connect to the Remote Azure server like to a usual MS SQL, you will have to use .Net Framework Data Provider. This could cause migration problems, because it doesn’t provide full data migration functionality and errors can appear during migration. • You could also use the Data Sync service, provided by Azure Management Portal. You will need to have a special Agent installed on the source MS SQL Server; and be careful to configure the source and destination servers, sync directions,
  15. 15. ©2012 by EliNext Group etc. Remember, you could always turn off the sync if you don’t need it anymore.As a conclusion, I’d like to say that for now Azure SQL doesn’t have acommon (standard) way for simultaneous structure & data migration.So, you will have to use some tricks to migrate them. In case ofstructure migration the most convenient way is Data TierDeployment. However, the way of data migration should be chosen byyou. All the ways described above have both positive and negativesides. And you have to think which of them will resolve all yourproject’s needs in Azure SQL database deployment from scratch.
  16. 16. ©2012 by EliNext GroupIndustries and Technology Areas:Industries: software developmentTechnology Areas: SQL Azure, Microsoft SQL Server, MS SQLServer, Windows Azure Platform, Windows Azure, databasedevelopment, cloud computing
  17. 17. ©2012 by EliNext GroupELINEXT GROUPWebsite: http://www.elinext.comEmail: info@elinext.comBlog: http://software-topics.comFacebook: Ireland office Marina House, Adelphi Quay Waterford, Republic of Ireland Phone: +353 (51) 347 477Belarus Development Center Vietnam Development Center155b Bogdanovich St. 37A Phan Xich Long St.220040 Minsk, Belarus Ward 3, Phu Nhuan DistrictPhone: +375 (17) 237 53 65 Ho Chi Minh City, Vietnam Phone: +84 (8) 3995 6849Suggested citation: EliNext Group.2012.“Azure SQL. Data and Structure Migration Road Map”<>