You can migrate a SQL database from an on-premises SQL server to an Azure SQL instance. To perform the migration, you use a restore procedure to restore the SQL database to the Azure SQL instance.
When you restore a database from an on-premises SQL Server to an Azure SQL instance, you need to use a staging SQL instance as an intermediate step. This is because Azure SQL is a managed service and doesn't provide direct access to the underlying file system, preventing direct restoration from .bak files. The process involves the following steps:
-
Restoring the .bak file to a staging SQL Server instance on the access node.
-
Exporting the restored database from the staging instance to a .bacpac file.
-
Importing the .bacpac file into the Azure SQL instance.
You must have a SQL Server instance installed on the access node being used for the intermediate restore step. This enables you to configure the Staging instance and Staging path on access node fields in the Restore options window.
The destination instance must be the same version or a later version of SQL than the source instance.
Procedure
-
From the Command Center navigation pane, go to Protect > Databases.
The Overview page appears.
-
On the Instances page, in the row for the on-premises SQL server instance, click the action button
, and then click Restore.
The Backup content dialog box appears.
-
Select the content to restore, and then click Restore.
The Restore options dialog box appears.
-
Select Out of place.
-
From the Restore type list, select Cross instance restore.
-
From the Destination server list, select the database server that has SQL server instance.
-
From the Destination instance list, select the on-premise SQL server to which you want to restore the data.
-
From the Access node list, select the access node.
-
From the Staging instance list, select the staging instance.
-
In the Staging path on access node box, enter the location where you want to stage the Azure BACPAC file.
Verify that you have sufficient space in the staging path for the restore operation.
-
If you want to rename the database, in the Data files section, type the new name for the database.
If you change the name of the database to a name of a database that already exists on the destination instance, the database will be overwritten.
-
To specify the database pricing tier, in the Advanced options section, select the Database tier for the database.
If you don't select a database pricing tier, the default Pricing Tier Standard S0 will be applied by default.
-
Click SUBMIT.