Jan Doggen (JanDoggenREMOVETHISSPAMBLOCKER (AT) planet (DOT) nl) writes:
Quote:
- If I try a backup/restore Server 2008 complains that it is a backup
from a database "other than the existing one" |
To restore a copy of a database, do this:
1) On the source machine, run "sp_helpdb dbtomove", and make note of the
names in the first column.
2) On the target machine, run "sp_helpdb someotherdb", where someotherdb
is a database where the files are located where you want to put the
files of the database you want to restore.
3) Run this command:
RESTORE DATABASE dbtomove FROM DISK = 'filepath'
WITH MOVE 'name1' TO 'path.mdf',
MOVE 'name2' TO 'path.ldf',
REPLACE
name1 and name2 are the names you got from 1. The "path" after TO is a
modified version of the path you got in 2).
I assumed that you used the GUI and was not able to second-guess it. One
can hardly blame you; the GUI is more confusing than helpful. Moreover,
with a script like this, you have something you can reuse.
--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx