I am trying to follow the instructions on the following post:
To summarize; I am building the logical file list then restoring the database:
RESTORE FILELISTONLY
FROM DISK = 'C:\KeltieCochrane_v220120220.BAK';
RESTORE DATABASE KeltieCochrane_v2
FROM DISK = 'C:\KeltieCochrane_v220120220.BAK'
WITH
MOVE 'KeltieCochrane_v2' TO 'C:\Program Files\...\KeltieCochrane_v2.mdf',
MOVE 'KeltieCochrane_v2' TO 'C:\Program Files\...\KeltieCochrane_v2_1.ldf';
I have no .MDF
or .LDF
in the target folder and understand that they are contained in the .BAK
backup file.
When I restore the database into an empty, new database, it states:
The backup set holds a backup of a database other than the existing 'KCDB'.
When I try to restore using the actual database name in the script (KeltieCochrane_v2) I get There are conflicting file locations specified for the file.
If I try to simply restore the database I get a standard 15105 error and the operating system cannot get the text for this error.
What am I doing wrong?
Best Answer
You're getting that first error because
kdcb
already exists. And the backed up database is not that same database. If you want to overwrite an existing, separate database (that isn't the same. With the same you don't need to specify replace), you need to include theREPLACE
option:WARNING!!! You need to be very careful and make serious consideration by specifying
REPLACE
. Here is an exact excerpt from BOL regardingREPLACE
: