Restoring a SQL Server Database from .bak and .mdf Files
Print this Article
$1 Domain Names
Last Updated:
June 11, 2017 9:40 AM
Tell us what you think!
Looking for Product Support?
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
- Open SQL Server Management Studio on your local machine.
- Right click the Databases folder. From the pop-up menu, select New Database.
- Enter a database name, and then click Ok.
- Right click the new database icon. From the pop-up menu, select Tasks -> Restore -> Database.
- Select the From Device option, and then click the browse button.
- Click Add and navigate to the appropriate file. Click Ok.
- In the Restore Database window, select the checkbox next to your .bak file.
- Switch to the Options page. Select the Overwrite the existing database checkbox.
- Click Ok.
- Verify the contents of your database, which is now active on your local machine.
- Publish your database using the Microsoft Database Publishing Wizard. For more information, see Publishing a Database Using the Database Publishing Wizard.
- Open SQL Server Management Studio on your local machine.
- Right click the Databases folder. From the pop-up menu, select Attach.
- Click Add and select the appropriate .mdf file. Click Ok, and then click Ok again.
- Verify the contents of your database, which is now active on your local machine.
- Publish your database using the Microsoft Database Publishing Wizard. For more information, see Publishing a Database Using the Database Publishing Wizard.