[ MSSQL ] restore bak file, mdf/ldf file

1. backup back file

right click at database > Tasks > Backup

2. restore back file

right click at database > Tasks > Restore > Database

restore_bak_file

 

NOTE : may have to untick

options > tail-log backup > take taillog backup before restore

and tick

options > restore options > override the existing database (WITH REPLACE)

options

NOTE:

– if need create new database, new database and restore from the new database. change database name

databaseNameChanged

– if need create new database, new database and restore from the new database.

Files > .mdf,.ldf filename should be changed

restore_as

3. backup mdf/ldf file ( copy database file )

3.1 stop SQL Server Service

3.2 copy and replace COM.mdf, COM.log.ldf in

Program Files\Microsoft SQL Server\MSSQL11.SQL2012DB\MSSQL\DATA\

( the path can be see from MSSQL Server Manager by right click > Properties

database_mdf_ldf)

4. restore mdf/ldf file ( copy database file )

from MSSQL Server manager, right click at `databases` node > Attach

add .mdf

attach_mdf_ldf

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s