Daily Restore\copy an Azure SQL DB to a Azure SQL MI.

Anoop Noel Nakkala 0 Reputation points
2024-02-06T22:29:01.0133333+00:00

Exploring options to schedule a restore or copy an Azure SQL Database to a SQL Server on Managed Instance (MI).

  • Both are located within the same subscription and resource group.
  • I've encountered similar requirements for restoring production databases to non-production environments for refreshing purposes. However, I haven't found any resources discussing the restoration of a database from Azure SQL DB to SQL MI

One known method is to export everything to a bacpac file and then importing it back to SQL MI. Looking at another other options and also best way to schedule this.

Thanks in advance.

Azure SQL Database
SQL Server Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RahulRandive 10,486 Reputation points Volunteer Moderator
    2024-02-07T02:59:39.07+00:00

    Hi @Anoop Noel Nakkala

    Below is a blog discussing database restoration with Automation. It covers the restoration process for both Azure SQL Server and managed instances

    Please check if it helps in your scenario

    https://techcommunity.microsoft.com/t5/azure-database-support-blog/restore-database-across-servers-azure-sql-database-and-azure-sql/ba-p/2636181

    Point number 4 in the blog- PowerShell commands to your runbook based on your Azure SQL resource type, if its Azure SQL database or Azure SQL managed instance.

    Thank you!


  2. Javier Villegas 900 Reputation points MVP
    2024-02-08T17:59:24.27+00:00

    Hello @Anoop Noel Nakkala I'll suggest you to have a look to DBATools to copy Table-by-Table since native restore from Azure SQL DB to MI is not supported https://docs.dbatools.io/Copy-DbaDbTableData.html Regards Javier


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.