Solved

Restoring a database backup into another database

Posted on 2014-10-08
5
145 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 10

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 49

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exchange 2013 tmp files 3 60
Database ERD 4 76
Are triggers slow? 7 23
Many to Many From without subform 11 37
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…

762 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