Solved

Restoring a database backup into another database

Posted on 2014-10-08
5
132 Views
Last Modified: 2014-10-14
Hello All,

I have an application pointing into 2 MS SQL 2005 databases, one called PRODUCTION and the other called TEST. I am attempting to replicate all information from the production database to the test database so they both have the exact same data in them.
To accomplish this, I have created a backup of the PRODUCTION database and I am now attempting to restore this backup into the TEST database using the restore utility in Management Studio. After selecting the TEST database --> right click --> Tasks --> Restore and choosing the backup that I made of my production database, in the "Restore the database as" section of the Options screen,  it appears that the restore will rename the TEST database to the name of my production database (mdf and ldf files) and I dont want this to happen, I want to maintain the original name of the database since I am sure what could happen with my application if the TEST database is renamed.

What should I do next?
0
Comment
Question by:LuiLui77
5 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 250 total points
Comment Utility
You should be able to update the file paths on the options screen to reflect the name of your test database and then check the checkbox to overwrite the database namely your test database.
0
 
LVL 24

Expert Comment

by:Mohammed Khawaja
Comment Utility
When you are choosing restore, have you click on the option to overwrite.  Also note that when you click on advanced, you have the option to rename the files.  When you select overwrite, it will overwrite the existing MDF and LDF with the data from the restored database.
0
 
LVL 10

Expert Comment

by:HuaMinChen
Comment Utility
Hi,
You can also copy the relevant .mdf and .ldf files to the folder like

C:\Program Files\Microsoft SQL Server\MSSQL11.SS2002\MSSQL\DATA

within the server and further attach the DB to the new server.
0
 
LVL 45

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 250 total points
Comment Utility
Since it's a production database I won't recommend to copy the .mdf and .ldf files because that means you'll need to stop the database during the operation.
As was said in the two first comments you can check the "overwrite the existing database" and then change the filenames and/or they location.
Here is a step-by-step on how to do it.
0
 

Author Closing Comment

by:LuiLui77
Comment Utility
Thank you Paul, it did work by overwriting and changing the paths to reflect the test Databases.

Thanks Vitor for the clarification.

Thank you all fr you input!
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now