Upgrade SQL Server to SQL Server
In this guide, you learn how to upgrade your user databases from previous versions of SQL Server to SQL Server 2019 by using the Data Migration Assistant (DMA).
For other migration guides, see Azure Database Migration.
Before beginning your migration project, it's important to address the associated prerequisites. Learn about the supported versions and considerations for upgrading SQL Server database.
To prepare for the migration, download and install the:
- Latest version of the MAP Toolkit.
- Data Migration Assistant v5.3 or later.
- Latest version of the Database Experimentation Assistant.
Confirm source environment is supported and you've addressed any prerequisites, you're ready to start the Pre-migration stage. The process involves conducting an inventory of the databases that you need to migrate. Next, assess the databases for potential migration issues or blockers, and then resolving any items you might have uncovered. The following two sections cover the pre-migration steps of discover, assess.
The discover stage identifies existing data sources and details about the features that are being used. It's helpful to get a better understanding of and plan for the migration. This process involves scanning the network to identify all your organization’s SQL instances together with the version and features in use.
To use the MAP Toolkit to create an inventory scan, complete the following steps.
- Download the MAP Toolkit, and then install it.
- Run the MAP Toolkit.
Open the MAP Toolkit, and then on the left pane, select Database. You'll be on the following screen:
Select Create/Select database.
Ensure that Create an inventory database is selected, enter a name for the database, a brief description, and then select OK.
The next step is to collect data from the database created.
Select Collect inventory data.
In the Inventory and Assessment Wizard, select SQL Server and SQL Server with Database Details, and then select Next.
Select the best method option to search the computers on which Microsoft Products are hosted, and then select Next.
Enter credentials or create new credentials for the systems that you want to explore, and then select Next.
Set the order of the credentials, and then select Next.
Now, you need to specify the credentials for each computer that you want to discover. You can use unique credentials for each computer/machine, or you can choose to use the All Computer Credentials list.
After setting up the credentials, select Save, and then select Next.
Verify your selection summary, and then select Finish.
Wait for a few minutes (depending on the number of databases) for the Data Collection summary report.
The Main window of the tool appears, showing a summary of the Database Discovery completed so far.
Report generation and data collection.
On the top-right corner of the tool, an Options page appears, which you can use to generate report about the SQL Server Assessment and the Database Details.
Select both options (one by one) to generate the report.
Assess and convert
After identifying the data sources, the next step is to assess the on-premises SQL Server instance(s). Use the Data Migration Assistant (DMA) to assess your source database before upgrading your SQL Server instance.
To use DMA to create an assessment, complete the following steps.
- Download the DMA tool, and then install it.
- Create a New Assessment project.
Select the New (+) icon, select the Assessment project type, specify a project name, select SQL Server as the source and target, and then select Create.
Select the target SQL Server version that you plan to migrate to and against which you need to run an assessment, select one or both of the assessment report types (Compatibility Issues and New features’ recommendation), and then select Next.
In Connect to a server, specify the name of the SQL Server instance to connect to, specify the Authentication type and Connection properties, and then select Connect.
In the Add Sources panel, select the database(s) you that want to assess, and then select Add.
Select Start Assessment.
Now wait for the assessment results; the duration of the assessment depends on the number of databases added and the schema size of each database. Results will be displayed per database as soon as they're available.
Select the database that has completed assessment, and then switch between Compatibility issues and Feature recommendations by using the switcher.
Review the compatibility issues by analyzing the affected object and its details for every issue identified under Breaking changes, Behavior changes, and Deprecated features.
Review feature recommendations across the Performance, Storage, and Security areas.
Feature recommendations cover various features such as In-Memory OLTP and Columnstore, Stretch Database, Always Encrypted (AE), Dynamic Data Masking (DDM), and Transparent Data Encryption (TDE).
- Review assessment results.
- After all database assessments are complete, select Export report to export the results to either a JSON or CSV file for analyzing the data at your own convenience.
Optional A/B testing
This step is considered optional and not necessary to complete migration. To use DEA for database migration testing, complete the following steps.
Download the DEA tool, and then install it.
Run a trace capture
On the left navigation tree, select the camera icon the go to All Captures.
To start a new capture, select New Capture.
To configure the capture, specify the trace name, duration, SQL Server instance name, database name, and the share location for storing the trace file on the computer running SQL Server.
Select Start to begin trace capture.
Run a trace replay
On the left navigation tree, select the play icon the go to All Replays.
To start a new replay, select New Replay.
To configure the replay, specify the replay name, controller machine name, path to source trace file on controller, SQL Server instance name, and the path for storing the target trace file on the computer running SQL Server.
Select Start to begin replay of your capture.
Create a new Analysis Report
On the left navigation tree, select the checklist icon to go to Analysis Reports.
Connect to the SQL Server on which you'll store your report databases.
You'll see the list of all reports in the server.
Select New Report.
To configure the report, specify the report name, and specify paths to the traces for the source and target SQL Server instances.
Review an analysis report
On the first page of the report, the version and build information for the target servers on which the experiment was run displays.
Threshold allows you to adjust the sensitivity or tolerance of your A/B Test analysis.
By default, threshold is set to 5%; any performance improvement that is >= 5% is categorized as ‘Improved’. The drop-down selector allows you to evaluate the report using different performance thresholds.
Select the individual slices of the pie chart to view detailed metrics on performance.
On the detail page for a performance change category, you'll see a list of queries in that category.
Select an individual query to get performance summary statistics, error information, and query plan information.
After assessing the source database instance(s) you're migrating, for heterogenous migrations, you need to convert the schema to work in the target environment. Since upgrading to a newer version of SQL Server would be considered a homogeneous migration, the Convert step is unnecessary.
After you have the necessary prerequisites in place and have completed the tasks associated with the Pre-migration stage, you're ready to complete the schema and data migration. A successful migration and upgrade means you've addressed all the issues discovered from the pre-migration stage.
Review the compatibility issues discovered with DMA tool.
Preserve backup logs, maintenance plans, and other automated tasks, including jobs by creating a backup of the system database msdb.
View linked servers by using SQL Server Management Studio. In the Object Explorer, right-click server objects to expand list.
Additional considerations may be needed based on the complexity of your data and environment.
Migrate schema and data
After assessing your databases, the next step is to begin the process of migrating the schema and database by using DMA.
Migrate schema and data sync
To use DMA to create a migration project, complete the following steps.
Create a New Migration project
Select the New icon, select the Migration project type, select SQL Server as source and target types, and then select Create.
Provide source and target SQL server connection details, and then select Next.
Select databases from the source to migrate, and then specify the Shared location accessible by source and target SQL servers for backup operation.
Be sure that the service account running the source SQL Server instance has write privileges on the shared location and that the target SQL Server service account has read privileges on the shared location.
Select Next, select the logins that you want to migrate, and then select Start Migration.
Now, monitor the progress of migration in the View Results screen.
Review Migration Results
- Select Export report to save the migration results to a .csv or .json file.
- Review the saved file for details about data and logins migration and verify successful completion of the process.
Data sync and cutover
For minimal-downtime migrations, the source you're migrating continues to change after the one-time migration occurs, data and schema may be different from the target. During this process, you need to ensure every change in the source are captured and applied to the target in near real time. After you verify changes in source have been applied to the target, cutover from the source to the target environment.
Support for minimal-downtime migrations isn't yet available for this scenario, so the Data sync and Cutover plans aren't currently applicable.
After you've successfully completed the Migration stage, you need to go through a series of post-migration tasks to ensure that everything is functioning as smoothly and efficiently as possible. The post-migration is crucial for reconciling any data accuracy issues and verifying completeness, and addressing performance issues with the workload.
For more information about these issues, specific steps to mitigate them, and after the migration see the Post-migration Validation and Optimization Guide.
After the data is migrated to the target environment, all the applications that formerly consumed the source need to start consuming the target. Accomplishing this will in some cases require changes to the applications. Test against the databases to verify that the applications work as expected after the migration.
For a matrix of Microsoft and third-party services and tools that are available to assist you with various database and data migration scenarios and specialty tasks, see Services and tools for data migration.
For other migration guides see Azure Database Migration Guide.
For migration videos, see Overview of the migration journey.