Is there a way to restore a SQL MI database without breaking the replication?

Stanley Young 1 Reputation point
2021-07-27T03:31:48.087+00:00

Hi All,

We followed the this link to restore a database in SQL MI, and got an error on the step of altering the new database name to match the original database name. The error says that the original database is in a replication relationship. I don't understand it because the original database has been dropped.

There is an user feedback written in 2019 mentioning the same issue. I wonder if there is a solution for it right now.

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Oury Ba-MSFT 19,426 Reputation points Microsoft Employee
    2021-07-30T19:54:40.217+00:00

    Hi @Stanley Young from My understanding if you are trying to restore to a different database or restore over the existing one this is not supported. System makes automatic back up of every database. Have you tried creating a new database from back up, It will not impact the operation of the original database. OR DO THIS :

    1. Wait sometime if the old database was deleted right away . This Would mean that the system thinks there exists a database with the same name

    Please let me know if you are still facing the same issue

    Regards,
    Oury


  2. Oury Ba-MSFT 19,426 Reputation points Microsoft Employee
    2021-08-16T16:46:43.533+00:00

    @Stanley Young

    Issue: Restore a SQL MI database using PITR without breaking the replication

    Analysis and Resolution:

    After providing the error screenshot, We have gone through the error screenshot, from the error message we observed that you were unable to rename a database after PITR. We have asked check if failover group is present or not on MI. From below screenshot, it is said that database rename is not possible if it is in failover group.

    123683-image.png

    You have confirmed failover group is present and you want to know if you can rename database without breaking the failover group (replication).
    It’s not possible to rename a database that is part of failover groups. Kindly refer below article.
    https://learn.microsoft.com/en-us/azure/azure-sql/database/auto-failover-group-overview?tabs=azure-powershell#failover-groups-and-point-in-time-restore

    Regards,
    Oury

    0 comments No comments

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.