How to create a duplicate copy of an active SQL 2012 SP1 database from it's .bak file

Running SQL Server 2012 SP1 need to create a duplicate copy of a production database for testing purposes, Do not want to affect the production database in any way. Need to know how to use the nightly backup file to restore and create a duplicate copy.
dowhatyoudo22Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Russ SuterSenior Software DeveloperCommented:
I do this all the time.

First, create a new database. Make sure you include the word "TEST" or something similar to identify it.

Next, right-click on that database and choose Tasks -> Restore -> Database...

Select "Device" and browse to the backup file.

Under Detination, MAKE SURE you select the database you would like to restore to. DO NOT use the default value.

Ensure the most recent backup set(s) are selected.

Select "Files" from the left where it says "Select a page"

Set the Restore As values to the new database file you have just created. Do this for both the Rows Data and the Log.

Select "Options" from the left where it says "Select a page"

Check "Overwrite the existing database (WITH REPLACE)"

Click "OK" and watch the magic happen.

In an ideal world the test database is on a different SQL server instance than the live database so there's no danger of overwriting it.
Deepak ChauhanSQL Server DBACommented:
Assuming you are restoring the copy at Test server. here is the steps.

1. copy .bak file to test server local directory.
2. connect SQL server using SSMS
3. Right click on Database folder
4. Select option restore database
5 Write the database name in "TO Database" text box
6. Click on "FROM Device" radio button and pick the backup file from directory
7. Go to Option page and change the data and log file location in Restore As column.
8 Click on OK and monitor the progress.

 RestoreDB-Sample.JPGRestoreDB-options.JPG

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Preston CooperDatabase AdministratorCommented:
You will want to script the backup, file copy of the database, and restore of the backup using T-SQL and SQL Agent jobs.  That way it will be automated.  

Consider using COPY Only option if you are making a separate full backup.
Vitor MontalvãoMSSQL Senior EngineerCommented:
dowhatyoudo22, do you still need help with this question?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.