Solved

sql backup

Posted on 2011-02-10
5
325 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
5 Comments
 
LVL 12

Expert Comment

by:ErezMor
Comment Utility
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 4

Expert Comment

by:evgeny_f31
Comment Utility
0
 
LVL 32

Expert Comment

by:ewangoya
Comment Utility

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
Comment Utility
In addition you may have to change the paths to the database files.
0
 
LVL 13

Accepted Solution

by:
geek_vj earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

772 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

11 Experts available now in Live!

Get 1:1 Help Now