?
Solved

sql backup

Posted on 2011-02-10
5
Medium Priority
?
334 Views
Last Modified: 2012-05-11
I have .bak file from sql server 2005, and now I want restore the .bak to sql server 2008
in other box.

How can I do that in SQL studio?
0
Comment
Question by:Webboy2008
[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 12

Expert Comment

by:ErezMor
ID: 34866744
right click "databases" in the object explorer of you sql management studio, and select restore database... then select "from device" option and point to the bak file you have.
that's about it
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 34866905

Save your backup file to the destination server
In SSMS, right click on Databases then select Restore Database

You will get a dialog as shown here

Type in the name of the database
Check From Device and use the button to locate your backup file
Click OK and the file should be restored to the new server
RestoreDB.png
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 34867851
In addition you may have to change the paths to the database files.
0
 
LVL 13

Accepted Solution

by:
geek_vj earned 2000 total points
ID: 34868889
Copy the .bak file onto the destination server (SQL 2008 hosted server). As this is on a different server, you need to give another location for placing data and log files. Here is the sample query for the same:

Restore database <newdbname> from disk = '<Backupfilelocationhere>'
with move '<Logicaldatafilenamehere>' to '<Give new location for placing the data file>'
, move '<Logicallogfilenamehere>' to '<Give new location for placing the log file>'
, stats = 1

Sample query would look like this: (Original database = Test & New database = Testnew"

Restore database Testnew from disk = 'C:\Test.bak'
with move 'Test_data' to 'D:\Testnew_data.mdf'
, move 'Test_Log' to 'E:\Testnew_Log.ldf'
, stats = 1
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

764 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