Restore a BAK file without having MDF file

  • I received a backup of a Database from a client, the BAK file, and would like to restore it to my SQL instance. I tried doing this thru SSMS and Restore Database, but get an error saying it cannot find the mdf file. I then created a Database with the same name as the BAK file and tried again, trying to restore to the Database I just created, but get an error saying this is not the same Database.

    Can I do this without having the original mdf file?

    Thanks,

    Brian

  • a restore from a .bak file will create the database files for you, but the directory structure needs to exist.

    run restore filelistonly from disk = 'wherever' to see where the files were located originally and what the logical file names were.

    then run the actual restore using the 'with move' clause or if using the gui specify where you want the files to go.

    ---------------------------------------------------------------------

  • That worked, thanks

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

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