Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need to use a SQL Server backup file to populate a remote server database

Posted on 2011-03-24
3
Medium Priority
?
330 Views
Last Modified: 2012-05-11
I have the following backup file on my local machine:

C:\Develop\Apps\StockPro\Data\aspnetstockpro_032411.bak
I have a new database on the remote server named StockProSel

I can connect to StockProSel from the SQL Server Management studio

What are the steps to populate StockProSel from the aspnetstockpro_032411.bak file?

Thanks,
0
Comment
Question by:Dovberman
3 Comments
 
LVL 2

Accepted Solution

by:
EL_Barbado earned 1200 total points
ID: 35207928
First you should copy the .bak file from your computer to the server itself. put the file preferably in the MSSQL\Backup directory.

To restore a full database backup

   1.After you connect to the appropriate instance of the Microsoft SQL Server Database Engine, in Object Explorer, click the server name to expand the server tree.
   2.Expand Databases. select the database you want to restore or type in the name.
   3.Right-click the database, point to Tasks, and then click Restore.
   4.Click Database, which opens the Restore Database dialog box.
   5.On the General page, the name of the restoring database appears in the To database list box. To create a new database, enter its name in the list box.
   6.In the To a point in time text box, either retain the default (Most recent possible)
   7.To specify the source and location of the backup sets to restore, click one of the following options:
          * From device
            Click the browse button, which opens the Specify Backup dialog box. In the Backup media list box, select one of the listed device types (File). To select one or more devices for the Backup location list box, click Add.
            After you add the devices you want to the Backup location list box, click OK to return to the General page.
   8.In the Select the backup sets to restore grid, select the backups to restore. This grid displays the backups available for the specified location. By default, a recovery plan is suggested. To override the suggested recovery plan, you can change the selections in the grid. Any backups that depend on a deselected backup are deselected automatically.
   9.To view or select the advanced options, click Options in the Select a page pane.
  10.In the Restore options panel, choose athe following option:
          * Overwrite the existing database  
  11.Optionally, you can restore the database to a new location by specifying a new restore destination for each file in the Restore the database files as grid.
  12.The Recovery state panel determines the state of the database after the restore operation. The default behavior is:
          * Leave the database ready to use by rolling back the uncommitted transactions. Additional transaction logs cannot be restored. (RESTORE WITH RECOVERY)

0
 
LVL 40

Assisted Solution

by:lcohan
lcohan earned 800 total points
ID: 35208010
Assuming StockProSel is a new empty database:

Copy the backup file aspnetstockpro_032411.bak to the SQL box where StockProSel  is located
Connect to the database StockProSel and right click it the select Tasks -> Restore -> Database ->
Click "From File" -> click Add on the Specify Backup window that pops up and navigate to the file aspnetstockpro_032411.bak and click it -> Check box Restore on the Restore window -> on the left panel click Options -> click Overwrite Existing database to overwrite StockProSel and check to make sure the files listed are the StockProSel physical files under the Restore as column.


0
 

Author Closing Comment

by:Dovberman
ID: 35208463
Both solutions work.

El Barbado gets 60 % of the points based on somewhat more detail supplied.

Thanks,
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Screencast - Getting to Know the Pipeline

824 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