Most of the time we need to run our web application to different system. Someone keep the feature of creating database in there application. But if we need to backup or restore the database then what we will do?
In this post I am trying to show you everything about that.
First Create a backup of database.
Step1: Right Click on the Database of which you want to create backup. From there Click Task and then Backup.
Step 2:Now Click OK to create backup. This create a backup file int the C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Backpup\DatabaseName.bak by Default.
You can also change this directory. To change this Directory First remove current location by Clicking on the Remove Button in the Right Side. Now Click on the add button. A new window will appear as following. From there first remove current location. Now Click on the Button as marked by red color.
A new window will appear as follow. Now select the place where do you want to save the backup file. Provide the file name. Here I provide DatabaseTest. N0w OK.
Now Click on the Options of the left menu. From right click on the Back up to a new media set….. as following image now provide a media set name. Here I give Database Test. Now Click Ok to finish backup process.
First I am going to delete the database of which I created backup. To delete the database Right Click on the database and click Delete.
A window will appear as follow. Here I am deleting every information of this database. If this database is open by any connection then you will not be able to delete this database. To delete then check close existing connection. Now click OK to complete delete process.
A new window will appear as from there select the file you on which you made backup. Click ok.
Now following window will appear. From here first select the check box of database (marked). Then To database dropdown list select the database to which you want to restore. There will be a name of your database (Here DatabaseTest). Select it. Now press OK. If everything is ok then your database will be restored and show a successful message.