Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Restoring to a new database SQL 2005

Posted on 2013-12-20
5
Medium Priority
?
627 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 400 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 1600 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

719 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