Migrating SQL Server Databases to the Cloud
Stellar Information Technology Pvt. Ltd.
Global Data Care Experts #1 in India since 1993
Migration of databases from on-premises environment to the cloud is becoming increasingly popular owing to the consumption-based pricing model, unlimited scalability, flexibility, and other benefits available in the cloud setup.
In fact, 75 percent of databases are expected to be deployed in or migrated to the cloud this year, according to a Gartner’s report .
However, moving SQL Server workloads from on-premises to the cloud is a challenging task as it can cause downtime and requires code restructuring. So, it’s vital to choose the right cloud service provider (CSP) to get greater returns from your cloud migration.
There are multiple cloud service providers to choose from. The leading ones are Amazon Web Services (AWS), Microsoft Azure, and Google Cloud. However, SQL Server runs best on Microsoft Azure . The Azure-based cloud service (such as Azure SQL Database) offers various benefits, such as built-in security features, one-click backup and recovery capabilities, etc.?
There are several ways to migrate SQL Server database to Azure SQL Database:
This article will discuss the first two methods of migrating databases running on SQL Server on-premises to Azure SQL Database. For information on using transactional replication for the migration, see this Microsoft documentation . Before we proceed, let’s first discuss the reasons behind migrating databases to Azure SQL Database.
Why Migrate SQL Server Databases to Azure SQL Database?
Azure SQL Database is a relational database service hosted on the Microsoft Cloud. This Azure-based cloud service can handle mission-critical database workloads. Plus, it provides advanced security options and features like point-in-time-restore, automated backups, etc., to increase business continuity. Further, it supports SQL Server tools, APIs, and libraries, making it easier for you to deploy the SQL Server solutions to the cloud without learning new skills.
Ways to Migrate SQL Server Databases to Azure SQL Database
To migrate your on-premises SQL Server database to Azure SQL Database, you can use any of these methods:
1. Migrate Data using Data Migration Assistant
Azure Database Migration Service is designed to support offline and online migration from multiple database sources (such as SQL Server, Oracle, MySQL, PostgreSQL, and MongoDB) to Azure data platforms. The Azure service helps migrate SQL Server databases to Azure SQL DB using the Microsoft Azure portal or PowerShell.
Before proceeding with the migration process, it’s vital to assess your on-premises database for any blocking issues (such as compatibility problems) that might prevent the migration. Once the assessment is complete, you can migrate the sample schema to Azure SQL DB. The Azure service provides Data Migration Assistant (DMA) tool for data assessment and migration.
Before using the DMA tool, you need to meet these prerequisites:
Following are the step-by-step instructions to assess and migrate the on-premises database to Azure SQL Database using the DMA tool.
Step 1 – Assess your On-Premises Database
While assessing the source database, you can choose to check one or both of these reports: Database Compatibility and Feature Parity.
Once you are done with the assessment, move to the next step.
Step 2 – Migrate Data to Azure SQL Database
After executing these steps, here’s how the Data Migration Assistant interface will look like:?
领英推荐
After deploying the schema, check the target Azure SQL Database instance for any anomalies.
2. BACPAC Export/Import
Another option to migrate databases from SQL Server to Azure SQL Database is by using a BACPAC File. It is a Windows file with a .bacpac extension that contains all the schema and data to be migrated.
The process starts with exporting schema and data from an on-premises database to the BACPAC file using the Export Data-Tier Application Wizard. And then, you can import from the BACPAC file into an Azure SQL DB using the Azure Portal.
The detailed steps are as follows:
Step 1 – Export to a BACPAC File using Export Data-Tier Application
Step 2 – Import from BACPAC File into Azure SQL DB using Import Database
Follow these steps to import from BACPAC file into a new database in Azure SQL Database:
Note: For large databases, the import procedure can take a lot of time to complete. So, it’s recommended to monitor progress of the Import/Export process by selecting the Import/Export history tab.?
You will see a?Completed?status once the import process is complete.
Note: You can import a BACPAC file into a single Azure DB. For migrating multiple databases, you will need to repeat steps 1 and 2.
Refer to this link for further information on migrating from an on-premises location to Azure SQL Database using BACPAC files.?
End Note
You can use Data Migration Assistant to move multiple databases concurrently. However, avoid using it for migrating large databases greater than 1 TB. Instead, you can use the BACPAC export/import method for quick and easy migration. But, you can only use BACPAC export/import to migrate small to medium-sized databases (less than 1 TB). Use Transaction replication to keep your SQL Server database online during the migration.
When migrating multiple databases from on-premises SQL Server to Azure SQL Database, databases can become corrupted. To save downtime and avoid the risk of losing table structures, using Stellar Repair for MS SQL can come in handy. The software can help fix corruption in the database(s) and recover the database objects in their original state.?