How do we backup and reste to another server

  • I need to take a backup and resotre to another  server master database.

    How to I force and resotore or  apecify a diffrent location.(in sql it d oes not show \\map drives.

  • RESTORE FILELISTONLY

       FROM DISK = 'c:\Northwind.bak'

    --This will give you the list of the logical files.

    RESTORE DATABASE TestDB

       FROM DISK = 'c:\Northwind.bak'

       WITH MOVE 'Northwind' TO 'c:\test\testdb.mdf',

       MOVE 'Northwind_log' TO 'c:\test\testdb.ldf'

    --This will restore it to the new location.

    Derrick Leggett
    Mean Old DBA
    When life gives you a lemon, fire the DBA.

  • Hi Chami,

      You can restore from another server by using the UNC path like:

    RESTORE DATABASE TestDB FROM DISK = '\\OldServer\backups\TestDB.bak'

      Derrik already pointed out the WITH MOVE option for placing the files in another location.

      Now you did say the MASTER database, which is another story.

      In order to restore the MASTER database, you need to start SQL Server in Single User mode, which you can do from a Command Prompt:

    sqlservr.exe -c -m

      You can then execute the RESTORE command using OSQL or Query Analyzer.  Note that you will need to restore the database to the same location that you installed it on this server.


    Regards,
    Steve

    Meddle not in the affairs of dragons, for you are crunchy and taste good with ketchup.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply