Replicate a database by using the link feature in SSMS - Azure SQL Managed Instance
Applies to:
Azure SQL Managed Instance
This article teaches you how to replicate your database from SQL Server to Azure SQL Managed Instance by using the link feature in SQL Server Management Studio (SSMS).
Note
- Some functionality of the link is generally available, while some is currently in preview. Review the prerequisites to learn more.
- You can also use T-SQL and PowerShell to set up the link to replicate your database.
Prerequisites
To replicate your databases to SQL Managed Instance through the link, you need the following prerequisites:
- An active Azure subscription. If you don't have one, create a free account.
- Supported version of SQL Server with required service update installed.
- Azure SQL Managed Instance. Get started if you don't have it.
- SQL Server Management Studio v19.0 or later.
- A properly prepared environment.
Set up database recovery and backup
All databases that will be replicated via the link must be in full recovery mode and have at least one full backup. Use SSMS to back up your database. Follow these steps:
- In SSMS, right-click on a database name on SQL Server
- Select Tasks, and then click on Backup Up.
- Ensure Backup type is Full.
- Ensure Backup-to option has the backup path to a disk with sufficient free storage space available.
- Click on OK to complete the full backup.
For more information, see Create a Full Database Backup.
Replicate a database
In the following steps, you use the Managed Instance link wizard in SSMS to create the link between SQL Server and SQL Managed Instance. After you create the link, your source database gets a read-only replica copy on your target managed instance.
Note
The link supports replication of user databases only. Replication of system databases is not supported. To replicate instance-level objects (stored in master
or msdb
databases), we recommend that you script them out and run T-SQL scripts on the destination instance.
Open SSMS and connect to your SQL Server instance.
In Object Explorer, right-click your database, hover over Azure SQL Managed Instance link, and select Replicate database to open the New Managed Instance link wizard. If your SQL Server version isn't supported, this option won't be available on the context menu.
On the Introduction page of the wizard, select Next.
On the SQL Server requirements page, the wizard validates requirements to establish a link to SQL Managed Instance. Select Next after all the requirements are validated.
On the Select Databases page, choose one or more databases that you want to replicate to SQL Managed Instance via the link feature. Then select Next.
On the Login to Azure and select Managed Instance page, select Sign In to sign in to Microsoft Azure.
- If you're running SSMS on Windows Server, the login screen in some cases might not show up with the error message
Content within this application coming from the website listed below is being blocked by Internet Explorer Enhanced Security Configuration.
. This happens when Windows Server blocks web content from rendering due to security settings configuration. In this case, you'll need to turn off Internet Explorer ESC on Windows servers.
- If you're running SSMS on Windows Server, the login screen in some cases might not show up with the error message
On the Login to Azure and select Managed Instance page, choose the subscription, resource group, and target managed instance from the dropdown lists. Select Login and provide login details for SQL Managed Instance. After you've provided all necessary information, select Next.
Review the prepopulated values on the Specify Distributed AG Options page, and change any that need customization. When you're ready, select Next.
Review the actions on the Summary page. Optionally, select Script to create a script that you can run at a later time. When you're ready, select Finish.
The Executing actions page displays the progress of each action.
After all steps finish, the Results page shows check marks next to the successfully completed actions. You can now close the window.
View a replicated database
After the link is created, the selected databases are replicated to the managed instance.
Use Object Explorer on your SQL Server instance to view the Synchronized status of the replicated database. Expand Always On High Availability and Availability Groups to view the distributed availability group that's created for the link.
Connect to your managed instance and use Object Explorer to view your replicated database. Depending on the database size and network speed, the database might initially be in a Restoring state. After initial seeding finishes, the database is restored to the managed instance and ready for read-only workloads.
Next steps
To fail over your database to SQL Managed Instance, see Failover a database. To learn more, see Link feature for Azure SQL Managed Instance.
Feedback
Submit and view feedback for