Solved

Restoring a database backup into another database

Posted on 2014-10-08
5
148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 250 total points
ID: 40369889
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 25

Expert Comment

by:Mohammed Khawaja
ID: 40369910
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 11

Expert Comment

by:HuaMinChen
ID: 40369947
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 51

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 250 total points
ID: 40370113
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
ID: 40379865
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

617 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