Solved

Restoring to a new database SQL 2005

Posted on 2013-12-20
5
600 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
[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
  • 2
  • 2
5 Comments
 
LVL 15

Assisted Solution

by:Berkson Wein
Berkson Wein 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

752 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