views:

1021

answers:

1

Database backup was created with files in location A Database files then moved to location B using ALTER DATABASE MODIFY FILE

Now restoring the backup using WITH REPLACE created when files were in location A. Should the WITH MOVE option be specified with the new location? Or does WITH REPLACE imply using the current locations regardless of where they were when the backup was created?

+1  A: 

You don't have to specify WITH MOVE.

Remus Rusanu
Here's the response I got on the MSDN forum:"WITH REPLACE will use the current locations of the files for all files with matching logical names. It's most relevant when you're restoring a database to a second server (eg test or DR) where the file structure doesn't match exactly. On your target, if you set up a new shell database with the same logical file names as your source (different paths, different file sizes, different filenames even), you can do a simple RESTORE WITH REPLACE, and the database will restore to the shell's location."
Aidan Ryan