With the data growing exponentially, organizations are slowly migrating from legacy application systems to modern systems, leveraging cloud-based storage. Instead of buying hardware and software, moving to the cloud helps organizations to just buy IT services from service providers. The cloud storage service is today the most preferred tool for migrating data.
What is Data Migration?
Data migration is moving or transferring data from one storage system, application, or database to another. It can be a challenging process, and organizations undertake migration to:
- Revamp or replace server or storage device
- Meet the growing data and performance issues
- Upgrade databases
- Build a new data center
- Merge new data from other sources
- Meet business process changes
- Reduce cost and complexity
Data migration involves selecting, preparing, and extracting data and a series of functions before you can upload it into the target location. There are several options available for transferring data to the cloud. The main two are:
Online migration - Data is moved across the Internet or a private or dedicated WAN connection without disruption. It means your applications will run during the migration process and will not impact the performance.
Offline migration - Data is physically shipped via a storage appliance between the origin data center to the target location. The downtime could vary depending on the amount of data migrated and the type of security required.
Introduction to Azure SQL Database Migration
Azure SQL Database is a Microsoft public cloud platform that depends on virtualization technology and provides multiple services such as Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Managed Database Services.
A scalable, relational database (RD) service built for the cloud, Azure offers AI-powered features that help optimize performance and automatically scale resources on demand.
Microsoft’s Azure is an ideal platform to migrate your On-Premise SQL database. It can help to reduce overhead costs, increase productivity and strengthen database security. There are multiple ways to migrate On-premises SQL Database to Azure SQL Database. Here we have listed seven ways to migrate your on-premises SQL Database to Azure.
Seven Ways to Migrate On-Premise SQL Database to Azure SQL Database
Data Migration Assistant (DMA)
The Data Migration Assistant tool identifies database compatibility issues that can affect your database functions when moving your On-Premise SQL Database to Azure SQL Database. DMA checks for any features that are not supported that can affect the migration process. It supports both online and offline options for migration. Apart from migrating on-premises databases to Azure, other databases such as MySQL, PostgreSQL, and MongoDB are also supported.
Suggested read: How to migrate SQL Server instance to Azure SQL database using Data Migration Assistant
Database Migration Services (DMS)
Post the assessment done by DMA, you can use the database migration service (DMS) to migrate workloads from different databases to the Azure Data platform. The migration can be offline or online.
Online the downtime is minimal and only happens in the final step when switching to the new environment. DMS allows you to assess, identify and migrate from on-premises to Azure SQL database by continuously synchronizing after the initial schema/data is moved. Using the assessment tools, you can assess migration blockers and features that hamper smooth data transition.
Online migration using DMS supports, SQL, PostgreSQL, Oracle, MySQL, RDS MySQL, and other sources that can be migrated to Azure SQL Data Base, Azure SQL VM, Azure SQL DB Managed Instance, Azure Cosmos DB, MySQL, PostgreSQL, etc.
Offline migration involves system downtime. Offline you can migrate just the schema or the schema and data in one shot. Ideally, you should use this method for testing small databases or those applications where more extended downtime does not affect productivity.
Transactional replication duplicates changes between two databases, including stored procedures, database objects like tables, views, data, and more. Data is copied in real-time from the source server (Publisher) to the receiving database (Subscriber). You have to add the Azure SQL Database as a subscriber and On-Premises SQL Database as the publisher when doing a transactional replication. It will let you easily migrate the data from your on-premises SQL Server to Azure SQL Database. Thus, transactional replication is a good backup for frequent, daily database changes. You can only replicate tables with a primary key. So if you have many tables without them, you’ll need to pair them with other techniques to move those tables.
DACPAC, or Data Application Component package, is a file that contains the details of your database objects, such as tables, stored procedures, views, and other database details.
Using SSDT, SSMS, or SQLpackage.exe, developers and database administrators can create a single DAPAC file consisting of database objects and restore one for Azure SQL Database.
Using BACPAC or Backup Package file, you can import a SQL Server database into Azure SQL Database. Because it contains both the database schema and data, you can perform the export and import efficiently. You can bring your entire On-Premise SQL database to Azure SQL Database.
Using the export data-tier application option on the on-premises database, you can export to BACPAC. You can import the BACPAC as an Azure SQL Database using the Azure portal. You can import the BACPAC file using SSDT, sqlpackage.exe, or SSMS.
Using the Import data-tier application option, you can use the BACPAC file to perform a restore to Azure SQL Database. It is easy to use if you are migrating small on-premises databases. But when you have to work with larger databases, use command line tools like sqlpackage.exe.
Import Export Using the BCP
BCP or Bulk Copy Program is not really a migration tool. You can combine it with others tools like transactional replication if you want to import an On-Premises database without primary keys. You can export the table to a data file using the Bulk Copy Program (BCP) utility. Once that is done, you can import data into an Azure SQL Database using the import option. You must ensure the receiving server has the correct formatting for the table structures. In case of any error in the table structure, the BCP import process will fail.
Suggested read: How to import and export bulk data using Bulk Copy Program
Generate Transact-SQL Scripts
You can use T-SQL Scripts to migrate and deploy a business applications toolset from the On-Premise SQL Server database to Azure. to migrate and deploy a business applications toolset from the On-Premise SQL Server database to Azure. It helps generate a plain text script file using the Transact-SQL language. The text file includes the complete database content and the database structure. The text can be viewed and edited using the SQL Server Management Studio or any text editor. It is very similar to BACPAC but there are limitations to SQL scripts - they might not work on very large databases.
GeoPITS Database Management Platform for Seamless Database Migration
GeoPITS has expertise in SQL Server database administration, performance tuning, problem-solving, and in-depth SQL Server Database training. If you are planning a migration, we are your go-to partner who can assist you in planning and implementing a complete database migration to Azure SQL Database Get in touch with us today.