I know this seems like a duplicate of another question, but it is not completely. I want to copy a production db (in use and critical) to another db on the same server, to allow doing some testing. What is the easiest safe way to do this ?
Here is my proposal (mostly found here):
BACKUP DATABASE srcDB TO DISK = 'D:\SQL\Data\srcDBtest.bak' WITH COPY_ONLY
RESTORE DATABASE testDB FROM DISK = 'D:\SQL\Data\srcDBtest.bak'
WITH MOVE 'srcDB' TO 'D:\SQL\Data\testDB.mdf',
MOVE 'erpSql_log' TO 'D:\SQL\Data\erpsqlPH.ldf', REPLACE, STATS = 10
Is that going to work ? Should testDB be created before running this ? Can I use any name in the TO argument of MOVE ?
I cannot afford to make a mistake, so clarification is welcome.
Due to the importance I would use Management Studio and follow the backup guides found on MSDN.
Database (SQL Server Management
Studio)
to: Create a New Database From an
Existing Database Backup (SQL Server Management
Studio)