Frequently Asked Questions

Help Center Search

Restoring a SQL Server Database from .bak and .mdf Files

Print this Article
Comment on this Article
Last Updated: June 10, 2008 9:40 AM

It is possible to restore a SQL Server database from a backup file (.bak) created outside the Hosting Control Center or from an MDF file. Doing so requires Microsoft Database Publishing Wizard and SQL Server with Management Studio.

For information on Database Publishing Wizard, see What are the Database Publishing Service and Database Publishing Wizard?.

Download SQL Server Express Edition with Management Studio here.

NOTE: We recommend you create SQL Server database backups through the Hosting Control Center. For more information, see Backing Up a SQL Server Database.

To Restore a SQL Server Database

From .bak files created outside of the Hosting Control Center

  1. Open SQL Server Management Studio on your local machine.
  2. Right click the Databases folder. From the pop-up menu, select New Database.
  3. Enter a database name, and then click Ok.
  4. Right click the new database icon. From the pop-up menu, select Tasks -> Restore -> Database.
  5. Select the From Device option, and then click the browse button.
  6. Click Add and navigate to the appropriate file. Click Ok.
  7. In the Restore Database window, select the checkbox next to your .bak file.
  8. Switch to the Options page. Select the Overwrite the existing database checkbox.
  9. Click Ok.
  10. Verify the contents of your database, which is now active on your local machine.
  11. Publish your database using the Microsoft Database Publishing Wizard. For more information, see Publishing a Database Using the Database Publishing Wizard.

From .mdf files

  1. Open SQL Server Management Studio on your local machine.
  2. Right click the Databases folder. From the pop-up menu, select Attach.
  3. Click Add and select the appropriate .mdf file. Click Ok, and then click Ok again.
  4. Verify the contents of your database, which is now active on your local machine.
  5. Publish your database using the Microsoft Database Publishing Wizard. For more information, see Publishing a Database Using the Database Publishing Wizard.