0% found this document useful (0 votes)
324 views12 pages

Azure SQL Database Backup & Migration Guide

This document describes how to use the Data Migration Assistant to assess a SQL Server database for migration to Azure SQL Database or a newer version of SQL Server. The assistant allows you to select databases, run compatibility assessments, view results on blocking issues and feature parity, and export reports. It can also upload results to the Azure Migrate hub to assess databases across an entire data estate for migration readiness.

Uploaded by

Alwin Figarafo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
324 views12 pages

Azure SQL Database Backup & Migration Guide

This document describes how to use the Data Migration Assistant to assess a SQL Server database for migration to Azure SQL Database or a newer version of SQL Server. The assistant allows you to select databases, run compatibility assessments, view results on blocking issues and feature parity, and export reports. It can also upload results to the Azure Migrate hub to assess databases across an entire data estate for migration readiness.

Uploaded by

Alwin Figarafo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Azure Backup & Migration
  • Perform a SQL Server Migration Assessment
  • Feature Recommendations
  • Assess a Data Estate for Target Readiness
  • Export Results

AZURE BACKUP & MIGRATION

Azure Backup

Using the same methods used to backup to DISK and TAPE, you can now back up to Microsoft Azure
storage by specifying URL as the backup destination. You can use this feature to manually backup or
configure your own backup strategy like you would for a local storage or other off-site options. This
feature is also referred to as SQL Server Backup to URL.

Prerequisites

 Microsoft Azure account


 Azure storage account
 MS SQL Server 2016 / 2017
 SQL Server Agent
 SSMS - 17.X
 DB Server should be on Internet connection
 system clock should be correct

Limitations

 Backup to premium storage is not supported.


 SQL Server limits the maximum backup size supported using a page blob to 1 TB. The maximum
backup size supported using block blobs is limited to approximately 200 GB (50,000 blocks *
4MB MAXTRANSFERSIZE). Block blobs support striping to support substantially larger backup
sizes.
 You can issue backup or restore statements by using TSQL, SMO, PowerShell cmdlets, SQL
Server Management Studio Backup or Restore wizard.
 Creating a logical device name is not supported. So adding URL as a backup device using
sp_dumpdevice or through SQL Server Management Studio is not supported.
 Appending to existing backup blobs is not supported. Backups to an existing blob can only be
overwritten by using the WITH FORMAT option. However, when using file-snapshot backups
(using the WITH FILE_SNAPSHOT argument), the WITH FORMAT argument is not permitted to
avoid leaving orphaned file-snapshots that were created with the original file-snapshot backup.
 Backup to multiple blobs in a single backup operation is only supported using block blobs and
using a Shared Access Signature (SAS) token rather than the storage account key for the SQL
Credential.
 Specifying BLOCKSIZE is not supported for page blobs.
 Specifying MAXTRANSFERSIZE is not supported page blobs.
 Specifying backupset options - RETAINDAYS and EXPIREDATE are not supported.
 SQL Server has a maximum limit of 259 characters for a backup device name. The BACKUP TO
URL consumes 36 characters for the required elements used to specify the URL -
'[Link] leaving 223 characters for account, container, and blob
names put together.
 If your server accesses Azure via a proxy server, you must use trace flag 1819 and then set the
WinHTTP proxy configuration via one of the following methods:
 The [Link] utility on Windows XP or Windows Server 2003 and earlier.
 The [Link] utility on Windows Vista and Windows Server 2008 or later.

Sites:

[Link]

[Link]
restore-with-microsoft-azure-blob-storage-service?view=sql-server-ver15

[Link]

[Link]
url?view=sql-server-ver15
Perform a SQL Server migration assessment with Data Migration Assistant

Create an assessment

1. Select the New (+) icon, and then select the Assessment project type.
2. Set the source and target server type.

If you're upgrading your on-premises SQL Server instance to a modern on-premises SQL Server
instance or to SQL Server hosted on an Azure VM, set the source and target server type to SQL
Server. If you're migrating to Azure SQL Database, instead set the target server type to Azure SQL
Database.

3. Click Create.

Choose assessment options

1. Select the target SQL Server version to which you plan to migrate.
2. Select the report type.

When you're assessing your source SQL Server instance for migrating to on-premises SQL Server
or to SQL Server hosted on Azure VM targets, you can choose one or both of the following
assessment report types:

o Compatibility Issues
o New features' recommendation
When assessing your source SQL Server instance for migrating to Azure SQL Database, you can choose
one or both of the following assessment report types:

 Check database compatibility


 Check feature parity
Add databases and extended events trace to assess

1. Select Add Sources to open the connection flyout menu.


2. Enter the SQL server instance name, choose the Authentication type, set the correct connection
properties, and then select Connect.
3. Select the databases to assess, and then select Add.

Note

You can remove multiple databases by selecting them while holding the Shift or Ctrl key, and then
clicking Remove Sources. You can also add databases from multiple SQL Server instances by
selecting Add Sources.

4. If you have any ad hoc or dynamic SQL queries or any DML statements initiated through the
application data layer, then enter the path to the folder in which you placed all the extended
events session files that you collected to capture the workload on the source SQL Server.

The following example shows how to create an extended event session on your source SQL Server
to capture the application data layer workload. Capture the workload for the duration that
represents your peak workload.
Copy

DROP EVENT SESSION [DatalayerSession] ON SERVER


go
CREATE EVENT SESSION [DatalayerSession] ON SERVER
ADD EVENT sqlserver.sql_batch_completed(
ACTION
(sqlserver.sql_text,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_id))
ADD TARGET package0.asynchronous_file_target(SET
filename=N'C:\temp\Demos\DataLayerAppassess\[Link]')
WITH (MAX_MEMORY=2048
KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=3
SECONDS,MAX_EVENT_SIZE=0
KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
go
---Start the session
ALTER EVENT SESSION [DatalayerSession]
ON SERVER
STATE = START;
---Wait for few minutes

---Query events

SELECT
object_name,
CAST(event_data as xml) as event_data,
file_name,
file_offset
FROM
sys.fn_xe_file_target_read_file('C:\temp\Demos\DataLayerAppassess\DatalayerSession*xel',
'C:\\temp\\Demos\\DataLayerAppassess\\DatalayerSession*xem',
null,
null)
---Stop the session after capturing the peak load.
ALTER EVENT SESSION [DatalayerSession]
ON SERVER
STATE = STOP;
go
Click Next to start the assessment.

Note

You can run multiple assessments concurrently and view the state of the assessments by opening the All
Assessments page.

View results

The duration of the assessment depends on the number of databases added and the schema size of
each database. Results are displayed for each database as soon as they're available.

1. Select the database that has completed the assessment, and then switch between Compatibility
issues and Feature recommendations by using the switcher.
2. Review the compatibility issues across all compatibility levels supported by the target SQL Server
version that you selected on the Options page.

You can review compatibility issues by analyzing the affected object, its details, and potentially a fix for
every issue identified under Breaking changes, Behavior changes, and Deprecated features.
Similarly, you can review feature recommendation across Performance, Storage, and Security areas.

Feature recommendations cover different kinds of features such as In-Memory OLTP, Columnstore,
Stretch Database, Always Encrypted, Dynamic Data Masking, and Transparent Data Encryption.
For Azure SQL Database, the assessments provide migration blocking issues and feature parity
issues. Review the results for both categories by selecting the specific options.

 The SQL Server feature parity category provides a comprehensive set of recommendations,
alternative approaches available in Azure, and mitigating steps. It helps you plan this effort in your
migration projects.
The Compatibility issues category provides partially supported or unsupported features that block
migrating on-premises SQL Server databases to Azure SQL databases. It then
provides recommendations to help you address those issues.
Assess a data estate for target readiness

If you want further extend these assessments to the entire data estate and find the relative readiness of
SQL Server instances and databases for migration to Azure SQL Database, upload the results to the
Azure Migrate hub by selecting Upload to Azure Migrate.

Doing so allows you to view the consolidated results on the Azure Migrate hub project.

Detailed, step-by-step guidance for target readiness assessments is available here.


Export results

After all databases finish the assessment, select Export report to export the results to either a JSON file
or a CSV file. You can then analyze the data at your own convenience.

Save and load assessments

In addition to exporting the results of an assessment, you can save assessment detail to a file and load
an assessment file for later review. For more information, see the article Save and load assessments
with Data Migration Assistant.

Site:

[Link]

Common questions

Powered by AI

The Data Migration Assistant helps facilitate SQL Server migration assessments by allowing users to set the source and target server types, select assessment report types such as Compatibility Issues or New Features' Recommendation, and assess databases by connecting to SQL Server instances with provided connection properties . Users can add sources, select databases for assessment, and optionally include extended events trace files to capture workloads . The assessment results can be reviewed for compatibility issues and feature recommendations, and users can export these to a JSON or CSV file .

When planning a SQL Server upgrade to an on-premises modern server or an Azure VM, considerations include choosing the appropriate assessment report types: Compatibility Issues and New Features' Recommendations . Compatibility Issues highlight potential problems related to new server version compatibility, helping to prevent migration failures due to unsupported features . New Features' Recommendations provide insights into leveraging new capabilities that could improve performance, security, or storage efficiency at the target destination . Tailoring these assessments to the specific migration target will ensure that both breaking changes and opportunities for enhancement are thoroughly evaluated, thereby smoothing the upgrade process .

When utilizing SQL Server Backup to URL, page blobs support a maximum backup size of 1 TB, while block blobs are limited to 200 GB, unless striping is used, which allows for larger sizes . Block blobs require a Shared Access Signature (SAS) for multiple blob operations, whereas page blobs do not have this requirement. These differences imply that block blobs offer less straightforward usability due to required striping and SAS tokens, but they offer more flexibility in terms of managing larger data sets by breaking them into smaller parts for backup .

The Azure Migrate hub aids in extending SQL Server migration assessments by providing a centralized platform where users can upload results, consolidate data, and assess the readiness of entire data estates for Azure migration . Benefits over standalone assessments include comprehensive insight into estate-wide migration readiness, the ability to track migrations across multiple servers and databases simultaneously, and access to aggregated results that highlight common themes and issues . These capabilities enable more strategic planning and resource allocation, improving the efficiency and effectiveness of large-scale migrations .

Compatibility issues detected during migration to Azure SQL Database include partially supported or unsupported features such as breaking changes, behavior changes, and deprecated features . The assessment provides recommendations for resolving these issues, which might involve adapting or replacing unsupported features with available Azure alternatives and implementing mitigation strategies to address detected incompatibilities . Feature parity issues, including missing features in Azure SQL Database, might also appear, and similar recommendations will be provided .

To capture application workload using an extended event session for assessment, first, create an extended event session that captures relevant SQL Server events, such as sql_batch_completed, while attaching action items like sql_text and client app name . Designate an asynchronous file target for storing event data, and configure the session with suitable properties like max memory and event retention mode . Start the session, let it run during peak workload times, then query the captured events for analysis. Finally, stop the session to finalize data collection .

Saving assessment results as JSON or CSV files in the Data Migration Assistant provides advantages such as readability and wide compatibility with data processing tools . JSON files are useful for detailed data representation compatible with web applications, allowing for easy parsing and integration. CSV files are supported by spreadsheet applications like Microsoft Excel, facilitating accessibility for users to manually review and manipulate data. These formats also support automation in further processing and reporting, making them flexible and efficient for technical and business users alike .

Compatibility issues in the Data Migration Assistant relate to breaking changes, behavior changes, and deprecated features that could hinder migration . These issues must be addressed to ensure migration success. Feature recommendations suggest enhancements that offer new functionality or improvements in Performance, Storage, and Security, advising on features such as In-Memory OLTP, Columnstore, and Always Encrypted that can be exploited post-migration to enhance system capabilities . Each category serves different goals: one ensures compatibility while the other illustrates opportunities for modernization .

When using SQL Server Backup to multiple blobs, a key challenge involves managing the Shared Access Signature (SAS) token required instead of the storage account key, which adds complexity to authorization procedures . The solution involves carefully issuing SAS tokens with appropriate permissions and ensuring all backup operations are correctly authenticated with strings that do not expire during operations. It requires careful setup and management to avoid permissions errors and to support data integrity and security .

The setup for SQL Server Backup to URL using Azure Storage requires a Microsoft Azure account, an Azure storage account, MS SQL Server 2016 or 2017, SQL Server Agent, SSMS 17.X, and an Internet connection on the DB Server . Limiting factors include no support for premium storage, backup size limits of 1 TB for page blobs and 200 GB for block blobs unless striping is used, and a maximum backup device name length of 259 characters . Furthermore, appending to existing backup blobs is not supported; backups must be overwritten using the WITH FORMAT option unless using file-snapshot backups .

You might also like