Floating FB popout byF5debug

SQL Azure – Migrating On-Premises SQL Server Database to SQL Azure Cloud – Option 2

 

Introduction:

In this article we are going to see the second option of migrating on-premises SQL Server 2005 database to SQL Azure using the SQL Server Migration Wizard. This tool is an open source free tool from Codeplex.com and we can see the documentation and the usage of this tool from the link. Since this is from the community Microsoft is not providing any support for this tool.

[more]

Overview:

In our earlier article we have seen the first option for migrating the database from local SQL Server 2005 On-Premises database to the cloud using the traditional approach. But in this article we are going to see the second option of doing the migration using the open source tool available from Codeplex.com. Now lets see the steps to do this migration process.

Steps:

First we need to download this tool from SQL Server Migration Wizard. Go to this link and we can see the Download option on the right side menu as shown in the screen below

clip_image001

We will get the download ready (Includes the Binary files), save it in a particular location and extract the files. We can see the list of files available as shown in the screen below

clip_image002

Now double click the file and we can see a window opened as shown in the screen below. This windows is the start up screen for this tool.

The Tool can use to migrate the data between the following

  • SQL Server to SQL Azure
  • SQL Azure to SQL Server
  • SQL Azure to SQL Azure

clip_image003

So now our step is to Analyze if our database to see if its possible for migrating to the cloud. Follow the below steps to do the same. Select SQL Database from the Analyze only option as shown in the screen below

clip_image004

Clicking on Next will Popup a window as shown in the screen below

clip_image005

Now we select our Server Name and the credentials to connect to the database and click on Connect. Now we can see the list of databases ready to migrate as shown in the screen below.

clip_image006

Now select the School database and Click on Next button as shown in the screen below. We can see options of database and stored procedures listed as shown below(Since this database has only Tables and Stored procedures compatible)

clip_image007

Now click on the Next button, we can see the Summary list as shown in the screen below. Before that we can see an option Advanced, clicking on that will open a window for user selection as shown in the screen below

clip_image008

Select the respective option from the list as per our requirement and click on OK button, Now we can see the summary as shown in the screen below

clip_image009

Click on Next button, now tool will be ready to prepare the script and you can see the progress as shown in the screen below

clip_image010

After completing 100% we can see the result windows as shown in the screen below

clip_image011

We have option to save the Scripts and also we have an option to see the SQL Scripts by clicking on the SQL Script tab as shown in the screen below

clip_image012

We can use this script to run it to the server destination as we do with the Option 1 which we saw in our earlier article on migration. Now we have an option to do that using this tool itself. Lets see the steps to do that using this tool. Click on Exit and open the tool newly and follow the below step by step process.

Now select the option to Analyze and Migrate option and Click on the Next button as shown in the screen below

clip_image013

Now we will get the same options which we did at the top of this article by connecting to the server, selecting the object and getting the summary and now we can see the option with the migration using the BCP as shown in the screen below

Note – Follow the steps from the top

clip_image014

Now once the script is completed we can see the result as shown in the screen below

clip_image015

Now click on the Next button to proceed further. We will get a popup as shown in the screen below

clip_image016

This window is for connecting to the SQL Azure database, we can see the Server Name sample shown in the window itself. Now go to the SQL Azure database and fetch the server information as shown in the screen below

clip_image017

Now go back to the tool and copy the server name and the login details as shown in the screen below

clip_image018

Now click on Connect button, and we can see an error as shown in the screen below

clip_image019

With this error we can see the description that this IP address is not added to the Firewall Rule (Check my article on how to add fire wall rules). Now add the IP to the firewall and Click on Connect once again. After successful authentication we can see the List of DB’s from the SQL Azure DB as shown in the screen below

clip_image020

Now Select the School database and Select Next. Here we have option to Create or Delete an existing database options. 

clip_image021

After clicking on Next button, will prompt a window to select to execute the script against the destination server as shown in the screen below

clip_image022

Click on yes will popup a window and we can see the progress bar and at the bottom we can see the result progress as shown in the screen below

clip_image023

clip_image024

If there are any problem with the scripts we can see the process gets freezed and we can see the process as shown in the screen below

clip_image025

Now we can have an option to edit the process/ or to Skip or Retry the process as shown in the screen below

clip_image026

Clicking on Edit will open the window editable as shown in the screen below

clip_image027

If we want to skip the process we can use it by clicking on the SKIP button at the bottom of the screen. We can see the list of objects failed in Red color as shown in the screen below

clip_image028

Now we will skip all the process and Now once the process is completed we can see the complete scripts executed and the progress bar shows completed as shown in the screen below

clip_image029

Now we are done with the Migration process and we can see the output in the SQL Azure window as shown in the screen window

clip_image030

To proceed further and test the same, go to the Manage database and we can see the screen with the latest tables and stored procedures as shown in the screen below

clip_image031

Conclusion:

So in this article we have seen on how to migrate the SQL Server 2005 database from Local server to the SQL Azure database using the SQL Azure Migration Wizard.

About Author: Karthikeyan Anbarasan, Microsoft MVP (Most Valuable Professional) in ASP.NET/IIS Architecture. He is the Founder and Chief Editor of the www.f5debug.net website and has authored books on Windows Phone and Business Intelligence(SSIS). He is also a Passionate Speaker and a Blogger on Microsoft Technologies.

You can Join Me On: Facebook, Twitter, Google Plus, LinkedIn

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Recent Posts

Random Posts

Most Viewed

URL Shortner

Create your own short urls!!!

Site Counter

free counters

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. For accuracy and official reference refer to MSDN/ TechNet. I have documented my personal experience on this blog.

Protected by Copyscape Web Plagiarism Finder

Site Meter