How to restore local databases to Azure Databases

We are in involved in several projects with Azure, and in one of them, we need to create an Azure Database to use with an Application Web and restore some information that we have onPremises on Azure Databases.

So, as you can imagine, is it not possible to restore a OnPremises database to Azure, you have to do additional steps, so the goal of this post is to explain that process:

First, you’ll need to create a SQL Database in Azure:

untitled

Give a name for the database. Once it is created, you will see the servername listed in the dashboard:

untitled1.png

So, we need to start the SQL Server Management Studio and connect to the Azure database, entering the server name and Login credentials:

untitled2.png

In SQL Server Management Studio, will now be listed the database created:

Sin título

Next Step is to connect to the Local SQL server instance and generate the scripts:

Sin título1.png

The script generator will now start. In this instance I have selected to script the entire database

untitled4

Before you create the script, click on the ‘Advanced’ button

untitled5

Under the advanced options, be sure to select to script the database for SQL Azure

untitled6

In my example, I chose to only script the schema but you can script the schema and or data

untitled8

After you are done, create the script

untitled9

Next step is to select Azure database in Management Studio and execute the script file you have previously generated

untitled10

Hit f5…

untitled11

After doing this, the schema will be created in the Azure database

untitled12

Easy, isn’t it?

Advertisement

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 )

Facebook photo

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

Connecting to %s