Migration III: On-Premise to Azure SQL Database
Table of Contents
On-Premise to Azure SQL Database Migration
This guide describes overall a database migration from a local installed SQL Server instance to an Azure SQL based database. This guide covers not all parts of networking, access management, cost controls, backups and uses the easiest approach to generate a quick going forward process for this scenario.
What you will need
- Administrative access to Azure and a valid subscription
- Access to your current SQL Server and Silverback database
- Administrative privileges on your current Silverback Server
- Domain administrative privileges may be required if Windows Authentication is currently used and changes to service accounts or permissions are necessary
- An Administrator account for the Silverback Management Console
- A Settings Administrator account for the Silverback Management Console
- An Azure SQL Server login with sufficient permissions to deploy databases
- Network connectivity and firewall access to the target Azure SQL Server from the machine running SQL Server Management Studio
- A maintenance window depending on the database size and expected migration duration
Review Database Authentication
Before starting the migration, you should verify which authentication method is currently configured for Silverback. Azure SQL Database does not support Windows-based SQL Server logins originating from an On-Premise environment. If Windows Authentication is currently used, the authentication method must be switched to SQL Server Authentication before the migration can continue.
Verify Current Authentication Method
- Open your Silverback Management Console.
- Login as Settings Administrator
- Navigate to Connection String
- Verify whether Use SQL Authentication is enabled or disabled
- If Use SQL Authentication is unchecked, you are using Windows Authentication and you need to switch to SQL Server Authentication first, otherwise a failure will appear during the Database Deployment to Microsoft Azure SQL Database:
One or more unsupported elements were found in the schema used as part of a data package. Error SQL71627: The element User: [IV\Silverback Enterprise Device Management] has property AuthenticationType set to a value that is not supported in Microsoft Azure SQL Database v12. Error SQL71627: The element Login: [IV\Silverback Enterprise Device Management] has property IsMappedToWindowsLogin set to a value that is not supported in Microsoft Azure SQL Database v12. (Microsoft.SqlServer.Dac)- If Use SQL Authentication is enabled, you can proceed with the Database Migration chapter
Switch from Windows to SQL Authentication
If your current Silverback installation uses Windows Authentication, you must switch to SQL Server Authentication before migrating the database to Azure SQL Database. The following steps describe how to create a SQL login, assign the required permissions and update the Silverback connection string. If SQL Authentication is already enabled, you can proceed directly with the Database Migration chapter.
Create new Login
- Open SQL Server Management Studio
- Connect to your SQL Server
- Navigate to Security
- Right-Click Logins
- Select New Login
- Enter a Login Name, e.g. Migrator
- Select SQL Authentication
- Enter a Password, e.g., Pa$$w0rd
- Enter the password again to confirm
- Disable User must change password at next login
- Select your current Silverback Database as default database
- Confirm with OK
Grant Database Permissions
- Navigate to Databases
- Expand the Silverback database
- Expand Security and then Users
- Right-click Users and select New User
- Enter the username, for example Migrator
- Click ... next to Login name
- Enter the name of the prevously created login, for example Migrator
- Select Check Names
- Select the previously created SQL login
- Press OK
- Leave the default schema empty
- Open the Membership page
- Enable db_owner
- Confirm with OK
Stop Services
- On the Silverback server, start a CMD or PowerShell Command
- Type: stop-service w3svc,silv*,epic*,mat*
- Press enter
- Wait until the Services are stopped
Connection String Backup and Reset
- On your Silverback Server, right-click the Search Icon and open the Registry Editor
- Confirm with Yes
- Expand to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\MATRIX42\
- Right Click Silverback
- Select Export
- Enter a file name, e.g. Silverback Registry Backup
- Click Save or save the backup to a different location
- Now right click SilverbackConnection
- Select Delete
- Confirm with Yes
Start IIS
- Restart Internet Information Services
- Open Internet Information Services Manager
- Select your Server
- Click in the right pane under Actions Restart
- Wait until the restart process is finished
Create your new Connection String
- Open your Browser
- Open localhost/admin
- Ignore the certificate warning message and continue with access to Silverback Website
- Re-Enter now your current SQL Database settings, but ensure to Enable Use SQL Authentication and Enter your recently created Login
- Press Save
- Wait Until the the Management Console will appear again
- Now you have verified that the SQL Authentication is working successfully.
Remove Windows Authenticated Database User
Perform this step only after verifying that Silverback is successfully using SQL Server Authentication
- Open your SQL Server Management Studio
- Expand Databases > Silverback > Security > Users.
- Locate the Windows user, for example IV\Silverback Enterprise Device Management.
- Right-click the user and select Delete.
- Confirm with OK
- Wait until the deletion is done
Database Migration
This section describes how to perform a database migration from an On-Premise scenario to an Azure SQL based database with the SQL Server Management Studio. Please note that the database deployment may take a lot of time. During testing, the migration of a 4 GB database took approximately 1 hour using a Standard S0: 10 DTUs Azure SQL Database configuration. In this example, SQL Server Management Studio is executed directly on the Silverback Server.
SQL Server Management Studio
The following section is based on SQL Server Management Studio 22 and the experience may change in the future.
- Download the latest SQL Server Management Studio installer.
- Run the executable
- Press Continue
- Wait until the Visual Studio Installer is ready
- In the Workload screen, enable Hybrid and Migration
- Press Install
- Wait until the installer is finished
- If a restart is required, press restart or not now in case you want to save something before rebooting the machine afterwards
- After the reboot, launch the SQL Server Management Studio
Deploy Database to Microsoft Azure SQL Database
Before starting the deployment, ensure that the public IP address of the machine running SQL Server Management Studio is allowed in the Azure SQL Server firewall configuration. Otherwise, SSMS will not be able to connect to the target Azure SQL Server.
- Connect to your current On-Premise SQL
- Locate your current Silverback Database
- Perform a right-click, select Task and select Deploy Database to Microsoft Azure SQL Database
- Press Next
- Press Connect next to Server Connection
- Enter your Server Name
- Example: imagoverum-sql.database.windows.net
- Select as Authentication SQL Server Authentication
- Enter your Login and Password
- Press Connect
Do not use a local SQL login from the source SQL Server in this step, including the temporary login created during the preparation steps (for example, Migrator). The credentials entered here must belong to a user that exists on the target Azure SQL Server and has sufficient permissions to deploy databases. Typically, this is the Azure SQL Server administrator account or another Azure SQL login with equivalent permissions.
- Select your desired Edition of Microsoft Azure SQL Database
- Select a Maximum database size (GB)
- Select a Service Objective
- Press Next
- Review the summary and press Finish
- Depending on your current database size, this process now may take a while
- Review the progress and once the operation is completed, press Close
Get New Connection String
- Login to your Azure Portal
- Enter in the search SQL and select SQL Server or locate your SQL Server by any other available way
- Example imagoverum-sql
- From the SQL Server Overview, expand Settings
- Select SQL Database
- Your recently deployed database should be listed here
- Click on your database
- On the top right area, press Show database connection strings
- Copy the ADO.NET (SQL Authentication) into your Clipboard
- Open any text editor and paste the string
Server=tcp:imagoverum-sql.database.windows.net,1433;Initial Catalog=Silverback;Persist Security Info=False;User ID=azuresqladmin;Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
- Based on your connection string, you can extract the following required information for later on:
- Data Server Address Server: imagoverum-sql.database.windows.net
- Database Name: Silverback
- Username: azuresqladmin
- Password: Pa$$w0rd
Change Silverback Connection String
After successfully deploying the database to Azure SQL Database, the Silverback connection string must be updated to point to the new database location. The following section describes how to replace the existing configuration and verify connectivity.
Stop Services
- On the Silverback server, start a CMD or Powershell Command
- Type: stop-service w3svc,silv*,epic*,mat*
- Press enter
- Wait until the Services are stopped
Connection String Backup and Deletion
- On your Silverback Server, right-click the Search Icon and open the Registry Editor
- Confirm with Yes
- Expand to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\MATRIX42\
- Right Click Silverback
- Select Export
- Enter a file name, e.g. Silverback Registry Backup
- Click Save or save the backup to a different location
- Now right click SilverbackConnection
- Select Delete
- Confirm with Yes
Start IIS
- Restart Internet Information Services
- Open Internet Information Services Manager
- Select your Server
- Click in the right pane under Actions Restart
- Wait until the restart process is finished
Create your new Connection String
- Open your Browser
- Open localhost/admin
- Ignore the certificate warning message and continue with access to Silverback Website
- Enter now your recently captured Azure SQL Connection Settings
- Use Azure SQL: enabled
- Data Server Address: imagoverum-sql.database.windows.net
- Database Name: Silverback
- Username: azuresqladmin
- Password: Pa$$w0rd
- Press Save
- Wait until the Management Console appears again
- Now you have verified that the new connection string is working successfully.
Post Migration Validation
The migration process is not complete until the functionality of the Silverback environment has been verified. The following validation steps should be performed to ensure that the application is successfully connected to the Azure SQL Database and operating as expected.
- Login as a Settings Administrator
- Navigate to Connection String
- Review your current settings and log out
- Now login as Administrator
- Verify that all devices are displayed
- Verify that application management is working
- Verify that device actions can be executed
- Press refresh on a device or execute a test action on a managed device
- Verify that device enrollments are working successfully
- Review the Silverback logs for database connectivity errors
- Monitor the Azure SQL Database for the first hours after migration
If all validation steps have been completed successfully, the migration from the on-premise SQL Server database to Azure SQL Database is complete.