Windows Azure – Migration of on premise SQL Server 2014 database to Azure – Part 2

In my previous post (On-Premise SQL Server Database Migration to Windows Azure), I had detailed migration of the database by connecting directly from SSMS (supported by SQL Server 2012 and 2014). Today, I will go through alternate migration method using data-tier application files (.dacpac files. For additional reference click here )

Prerequisite: This article also refers to usage of Blobs container in Azure Storage account. The steps explained here requires you to have an Azure Storage account configured with valid access keys for connectivity. If you aren’t familiar with Azure Storage account, go through my post (Windows Azure – Configuring Storage Accounts)

There are two stages in the migration. The first stage is to generate the .bacpac file of your target on-premise database for migration. The option in SQL Server 2014 is shown below:

Untitled0

 

For the destination, you have to connect to your Azure Storage account. Establish the connectivity using your Account Key.

Untitled

Once connected to your Azure storage, select the container (here, I have selected my Blob Container )

Untitled1

Few moments of waiting; and your .bacpac is uploaded to cloud storage.

Untitled2

The second stage is performed at Azure portal. Login to your azure account and select the SQL database server, and select the option “Import Database”

Untitled3

Select the Azure Storage and the container  as shown below

Untitled4

Select the .bacpac file

Untitled5

Specify the Pricing tier desired, database name and user account for login

Untitled51

Few moments of waiting… your database is getting created on the target server.

Untitled67

And the success notification. The database is online !

Untitled7.png

For verifying the database, let us try connecting from your local SSMS 2014 to new database in Azure and probably fire up some queries & procedures.

Untitled8

Whohaa ! All looking good here

Untitled9

For connectivity from your application, remember to use the connection strings as specified in Azure DB server. For example, connection strings format for this Sales DB to be used in your applications are specified below:-

ADO.NET

Server=tcp:{servername}.database.windows.net,1433;Database=SalesDB;User ID={username_here}@{servername_here};Password={your_password_here};Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

JDBC

jdbc:sqlserver://{servername_here}.database.windows.net:1433;
database=SalesDB;user={your_username_here}@{servername_here};password={your_password_here};encrypt=true;
trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;
loginTimeout=30;

 

Advertisements

One thought on “Windows Azure – Migration of on premise SQL Server 2014 database to Azure – Part 2

  1. Pingback: Connect your MVC application to Azure SQL Database using Entiry Framework | MSBLOGS | Biju Paulose

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s