I wont restore my database but the location path is not the same. How can i change this path(partition)?
RESTORE DATABASE [MY_DATABASE]
FROM DISK = 'C:\Content.bak'
WITH FILE = 1,
NOUNLOAD,
STATS = 10
Error Message:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "F:....\Content01.mdf" failed with the operating system error 3(failed to retrieve text for this error. Reason: 15100).
Msg 3156, Level 16, State 3, Line 1
File 'Content01' cannot be restored to 'F:....\Content01.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "H:....\Content01_log.LDF" failed with the operating system error 3(failed to retrieve text for this error. Reason: 15105).
Msg 3156, Level 16, State 3, Line 1
File 'Content01_log' cannot be restored to 'H:....\Content01_log.LDF'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
THANKS.
Use SQL Repair Tool to Restore Database. If you failed to attach a database due to corrupted or damaged MDF file, use Stellar Repair for MS SQL software to repair the MDF file.
Restore a database to a new location; optionally rename the database using SSMS. Connect to the appropriate instance of the SQL Server Database Engine, and then in Object Explorer, select the server name to expand the server tree. Right-click Databases, and then select Restore Database.
RESTORE DATABASE [My_Database]
FROM DISK = 'C:\Content.bak'
WITH MOVE 'MyDatabase_Data' TO 'C:\Data\MyDatabase_Data.mdf',
MOVE 'MyDatabase_Log' TO 'C:\Data\MyDatabase_Log.ldf',
REPLACE,
STATS=10
Use the WITH MOVE
command of the restore as discussed in this SO Question.
If anyone is here because they are restoring a database with multiple files, each destination file needs a new name. Using SQL Server 2008 R2, the gui does not provide an obvious clue nor does it solve it automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With