Pages

Monday, December 29, 2014

How to make a database copy from production to staging server in Azure

On the same server




1.       Connect to destination server (Here Staging DB) “master” database with productions username and pwd  because we need to have same username with pwd on source and destination DB.

2.       Execute the following command:
a.       CREATE DATABASE [NEWDATABASENAME] AS COPY OF [SOURCE_SERVERNAME].[SOURCEDATASE]
b.      IMP: Replace the NEWDATABASENAME, SOURCE_SERVERNAME and SOURCEDATASE with correct names
To track progress you can run following command or you can connect to Azure portal and check the progress in database tab

3.       Execute: Select *  from sys.dm_database_copies, this will give you the stats of the % of database copied

1 comment: