Migrate your database to SQL Azure
PREREQUISITES: You must have created your SQL server in Azure SQL and have an empty database. For more information, see Quickstart: Create an Azure SQL database in the Azure portal
- Configure the Azure SQL firewall.
To be able to access your Azure SQL database server from your local machine, add a firewall rule for your IP:
- Login to the Azure Management Portal and select SQL servers.
- In the tree on the left, select your database server.
- In the central settings pane, select Firewall.
- In the right pane, allow access to the Azure Services.
- Copy Your current IP address, displayed beside the Client IP Address, and paste it in the START IP and END IP range input fields.
- Save your changes.
- Migrate your local database to Azure SQL.
If you use SQL Express data file, you must first attach it to a running SQL Server instance.
- Download and run the Data migration Assistant.
- On the Select Process step, select Analyze and Migrate » SQL Database.
- Provide connection information to your local database.
No changes to the default settings are required until the script generation is completed on Results Summary screen.
- On the next step, provide connection information for your Azure SQL database server.
In Server, enter the Azure SQL Server fully qualified DNS name.
The name must have the following format: <yourservername>.database.windows.net.
You can find the fully qualified DNS name in the following way:
- In the Management Portal of Microsoft Azure Platform, click Database.
- Select your database instance and expand Properties pane in the right.
- The name appears in Fully Qualified DNS Name field.
- Select an empty database you have already created for this deployment or create a new one.
To create a new database, click Create Database button, enter name and size, and confirm.
- Click Next and confirm the execution of the previously generated migration SQL script against this database.
- When you are finished, click Exit to close the Migration Wizard.
- Change the connection string in the DataConfig.config file of your project to point to the Azure SQL instance, where you have migrated your database.
The format of the connection string element is the following:
<add dbType="SqlAzure" name="Sitefinity" connectionString="Server=<serverName>.database.windows.net;User ID=<userName>@<serverName>;Password=<password>;Database=<databaseName>; Trusted_Connection=False;Encrypt=True" providerName="System.Data.SqlClient" />
NOTE: For Sitefinity CMS to function normally with Azure SQL, set the dbType attribute to SqlAzure.
RECOMMENDATION: We recommend that you keep the Visual Studio solution for future purposes, such as upgrade.