What is the best way to migrate SQL database to another SQL server in Azure. Minimal downtime.

|_SQLViking_| 26 Reputation points
2024-10-12T09:25:12.3266667+00:00

Hi!

I am fairly new to Azure, but have good onprem experience.

Asked to migrate two databases (both used by an app) to another subscription/rg/location.

Databases are hosted on Azure SQL Logical Serve, that is also the target. Standard tier.

So the customer wants this:

  1. move the two databases
  2. check if all is ok from the app side (eg connection ok/user have proper access)
  3. stop app, replicate changes to new server
  4. failover app to use new sql server

All this with minimal downtime of course.

In other words, I think this is quite normal scenario.

Size of databases are aroud 200 GB.

What is the recommended/preferred way of completing this?

Azure SQL Database
SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. NIKHILA NETHIKUNTA 4,600 Reputation points Microsoft External Staff
    2024-10-14T04:03:03.91+00:00

    @|SQLViking|
    Thank you for the question and for using Microsoft Q&A platform.
    Based on the information you provided, using the Azure Database Migration Service (DMS) to migrate your databases would be better. DMS is a fully managed service designed to enable seamless migrations from multiple database sources to Azure data platforms with minimal downtime.

    Here are the steps you can follow to migrate your databases using DMS:

    1. Create a new Azure SQL Database logical server in the target subscription/region.
    2. Create a new Azure SQL Database on the target logical server with the same configuration as the source database.
    3. Create a migration project in DMS and configure the source and target endpoints.
    4. Select the databases you want to migrate and start the migration.
    5. Monitor the migration progress and verify that the databases have been successfully migrated.
    6. Update the app connection strings to point to the new database server.
    7. Perform a final synchronization to ensure that all data changes have been replicated to the new server.
    8. Failover the app to use the new SQL server.

    To minimize downtime, you can perform the migration during off-peak hours and use the DMS feature called "continuous data replication" to replicate changes from the source database to the target database in near real-time. This will help ensure that the target database is up to date when you are ready to failover the app.

    After the migration is complete, you can use the Azure portal or other tools to verify that the app is connecting to the new database server and that users have proper access.

    You can refer to the below links:
    https://learn.microsoft.com/en-us/azure/dms/
    https://learn.microsoft.com/en-us/data-migration/sql-server/database/overview
    https://learn.microsoft.com/en-us/data-migration/sql-server/database/guide
    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

  2. Anonymous
    2024-10-14T05:36:07.1933333+00:00

    Hi @|_SQLViking_| ,

    Thank you for your reaching out and welcome to Microsoft QA!

    Do you mean you want to minimize the downtime when migrating to Azure SQL? or you can check out this article.

    Please look at this:

    User's image

    In addition, here are my suggestions of how to migrate SQL database to Azure. Hope these can help you better understand each step in migrating:

    1. It is unlikely that you'll have any compatibility or feature parity issues if the source and target SQL Server versions are the same.
    2. Before migration, it's a good practice to run an assessment of your SQL Server databases if the versions are different. We recommend the Azure Migrate to discover and assess single databases or at scale from different environments. This extension collects performance data from your source SQL Server instance to provide right-size Azure recommendation that meets your workload's performance needs with minimal cost. You can see this article to learn more. NOTE: Please ensure the logins used to connect the source SQL Server are members of the sysadmin server role or have CONTROLSERVER permission.
    3. There are many migration methods to migrate your databases. Please read this article carefully and choose appropriate method, the steps of each method are list detailed in this article.
    4. We recommend the DMS first. It provides online and offline migration modes. You can check the limitations between them to choose the better method.
    5. Not all SQL Server versions support all compatibility modes. Check your target SQL Server version supports your chosen database compatibility. We recommend the DMA to assess on-premises SQL Server instances and understand the gaps between the source and target versions.

    I hope this helps! If you have any more issues or need further assistance, feel free to share with us!

    Best regards,

    Lucy Chen


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://docs.microsoft.com/en-us/answers/support/email-notifications


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.