Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

Database Restoration Problem

I have a Backup of a Database. I want to restore it on other Sql Server. Installation Paths are all different. Problem arrises when I restore this Databse. Error shows that

Device Activation Error The Physical File Name D:\-----\mydb.mdf may be incorrect.
same Error with .ldf file

I read Microsoft article . IT told me that First Detach all Databases from Destination server like master, Pubs etc etc and then first Restore all these Databases and then restore your Own mydb Database.

Tell me the exact Procedure of restoring or attaching a Database whenever I have only .BAK File.
0
musalman
Asked:
musalman
2 Solutions
 
MikeWalshCommented:
a .bak file is a database backup file.  An MDF is the data file that actually contains the data in the database. The .LDF is the transaction log.

You don't need to attach here, you need to restore.

What is probably happening is you are just trying to restore it exactly as it was on your source server without changing the file paths. You will need to use RESTORE and use the WITH move command to move the logical files to the proper drives/folders on the destionation server.

Look up RESTORE in books online and look at the example with the MOVE commands.
0
 
QPRCommented:
When you navigate to the bak file to restore from (and click ok) you should see 2 sides to the next window.
The logical file name and the file path.
As Mike says the path shown will be then one relevant to the server where the bak file originated from.
Click on this (right hand side) and change the path to suit.
0
 
chhapia_chintakCommented:
When yoy click on "restore database" first select the database backup file (.bak) then go to "option" property page/ tab of a window. In option you can find colums like "logical file name" and "move to physical file name". Change the  "physical file name " to existing lcation on your drive and this problem will be solved.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now