• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

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

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
Dovberman
Asked:
Dovberman
2 Solutions
 
EL_BarbadoCommented:
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
 
lcohanDatabase AnalystCommented:
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
 
DovbermanAuthor Commented:
Both solutions work.

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

Thanks,
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now