Solved

Restoring to a new database SQL 2005

Posted on 2013-12-20
5
594 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

831 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