Move Azure SQL Database

Handian Sudianto 6,621 Reputation points
2023-12-28T02:00:07.9533333+00:00

Hello,

How we can move SQL DB from one Azure SQL server to another Azure SQL Server?

Azure SQL Database
{count} votes

Answer accepted by question author
  1. Nandan Hegde 36,716 Reputation points MVP Volunteer Moderator
    2023-12-28T03:45:23.5466667+00:00

    Hey,
    Similar thread :

    https://stackoverflow.com/questions/24028958/copy-sql-azure-database-to-different-server

    There is no way to directly move the database from 1 server to another.

    You need to copy /clone the db from 1 server to another and then delete the original one.

    To copy the database, there are multiple ways
    User's image

    Powershell :

    New-AzSqlDatabaseCopy -ResourceGroupName "<resourceGroup>" -ServerName $sourceserver -DatabaseName "<databaseName>" `
        -CopyResourceGroupName "myResourceGroup" -CopyServerName $targetserver -CopyDatabaseName "CopyOfMySampleDatabase"
    

    Additional details :

    https://learn.microsoft.com/en-us/azure/azure-sql/database/database-copy?view=azuresql&tabs=azure-powershell#copy-using-the-azure-portal

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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