SQL Server 2000 Backup file - Restore question

  • I'm working on a proj for a client, they sent me their DB as a backup file. I wanted the MDF file so I could just attached it, because I'm under the impression that you can only restore a backup file to the server where it was backed up.

    I'm not sure how to load their DB with the Backup file they sent me, I've tried importing, attaching, and restoring to no avail.

    Should I request the MDF file for this to work? I usually just manually copy the MDF file to the data directory, and attach. How do I import or attach a DB Backup file? (All parties involved are using SQL Server 2000)

  • A restore will work without any problems if the backup is good. First, verify you've got a good backup:

      restore verifyonly from disk='d:\path\backupfile'

    Next, identify the logical files present in the database:

      restore filelistonly from disk='d:\path\backupfile'

    Now, using the info returned from the last step, issue the restore:

      restore database MyNewDBName from disk='d:\path\backupfile'
      with recovery, stats=10,
      move 'logicalDataFile1' to 'd:\newpath\todatabase_dat_1.mdf',
      move 'logicalDataFile2' to 'd:\newpath\todatabase_dat_2.ndf', --...etc, etc.
      move 'logicalLogFile1'  to 'd:\newpath\todatabase_log_1.ldf'

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

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