Solved

Restoring to a new database SQL 2005

Posted on 2013-12-20
5
590 Views
Last Modified: 2013-12-20
We have a  SQL server with a database "OurDB". I am trying to create a copy of that database on the same server using SQL Server Management Studio. I tried two ways:

1) I right-clicked 'databases' -> Retore -> Typed in "OurTestDB"  in 'To database' field -> Selected "OurDB" in 'From database' dropdown. When I hit OK, it says "You must select a restore source".
What does this mean? I have done restores like this before. Does this error mean the backup policies are set up in some way?

2) So I backed up "OurDB" and followed the same steps as above, except that I selected 'From Device' field during restore, and browsed to OurDB.bak. This added a back up set and I selected it. Now when I hit OK, it either keeps running with 0% progress or gives me an error something like "The back up set you selected belongs to a database other than OurTestDB"

Please advise.
0
Comment
Question by:Angel02
  • 2
  • 2
5 Comments
 
LVL 15

Assisted Solution

by:weinberk
weinberk earned 100 total points
ID: 39731876
I don't have SQL Server 2005 installed anymore, but from memory, when you go to restore there's an additional tab where you can specify the name of the database and log files that are to be written to.  Change the names there so that it's not the same as the original database.  Again from memory, I recall this same sort of thing happening if the names aren't changed (and you WANT to change them otherwise the original DB will have trouble if it worked for some reason without the change).

Hope this helps.
0
 
LVL 9

Accepted Solution

by:
QuinnDex earned 400 total points
ID: 39731911
create a new database giving it a new name, right click the new database and select:

 tasks>restore>database

select device and then browse to your backup set, select the set to restore by checking the tick box

click options in the left side pane

check overwrite existing database(with Replace)

in the window "restore the database files as, edit the database original  name to match the new name of your new database, then in the restore as column change the names of the mdf and ldf files to match (dont change the path)

click ok and you should be good to go
0
 

Author Comment

by:Angel02
ID: 39731984
Thank you for the response.
I checked overwrite but in the window "Restore the database files as:", it wouldn't let me edit the 'Original File Name' column. I could just edit the 'Restore As' column. I kept the path the same and just changed the names of files to OurTestDB.mdf and OurTestDB.LDF.

Is it OK?
0
 
LVL 9

Expert Comment

by:QuinnDex
ID: 39732021
that should still work
0
 

Author Comment

by:Angel02
ID: 39732035
Worked great! Thank you.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

758 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

19 Experts available now in Live!

Get 1:1 Help Now