Home Forums SQL Server 2005 Backups Restoring Back-Ups into a Different Server RE: Restoring Back-Ups into a Different Server

  • while you may find it a little harder to do then using a GUI in SSMS but TSQL is better to this.  I have posted a script that you just need to change the database name and data/log filename and the location you need to restore.  Prior to this you can run the first command to find out about the database file names if you don't know.  For the example I assume that your database name is mydb1.  Once you restore your database in dev environment you may want to change the recovery mode to simple if you don't want/need to take a log backup and prevent the log file growth.

    restore filelistonly from disk= 'c:\mydb1.bak'

    restore database mydb1 from disk = 'c:\mydb1.bak' with

     move 'mydb1_Data' to 'D:\MSSQL\Data\mydb1_Data.mdf',

     move 'mydb1_log' to 'e:\MSSQL\Log\mydb1_Log.ldf';

    if you need to change the recovry mode run this

    Alter database mydb1 Set Recovery Simple

    good day,

    Bulent