How to Copy Azure SQL Database to another Subscription ?

Sid_1805 91 Reputation points
2021-10-30T18:44:22.38+00:00

How to Copy Azure SQL Database to another Subscription ?

I do not find specific documentation in Resource mover for Azure SQL. Can someone please re-direct me?

Looking for pre-requites like Private End point enables Dbs, how to move its dependencies, associated central log analytics ( use for logging) to the Azure SQL etc...

thanks!

Azure SQL Database
{count} votes

6 answers

Sort by: Most helpful
  1. Oury Ba-MSFT 20,911 Reputation points Microsoft Employee Moderator
    2023-09-27T00:34:21.2666667+00:00

    Swathi Sudheer

    Could you please try the below and let us know if that works.

    In SSMS, connect to both servers in a different tenant.

    Once you are connected, click on the database name where you want to coly the objects from by selecting select "Tasks" > "Generate Scripts". In the "Generate Scripts" wizard, select the objects you want to copy and choose the "Script entire database and all database objects" option. Then, choose the output format for the script (e.g., SQL file) and save the script to a file.

    1. Modify the script: After generating the script, you can modify it to remove any references to the data in the database. You can do this by removing any INSERT, UPDATE, or DELETE statements from the script if needed.
    2. Execute the script on the target tenant: Once you have modified the script, you can execute it on the target tenant to create the database schema and objects. You can do this by connecting to the target tenant in SSMS or ADS and running the script.

    By following these steps, you can copy the objects of an Azure SQL Database from one tenant to another tenant without copying the data. Keep in mind that this method only copies the database schema and objects and does not copy any data or user permissions. You will need to manually recreate any data and user permissions on the target tenant.

    Hope that helps.

    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.