We help IT Professionals succeed at work.

restore 2005 sql .bak to 2005 or 2008 sql server

onyxa
onyxa asked
on
I keep receiving existing database error either in the wizard or thru the query.  here is what I entered and received back

RESTORE DATABASE Patra
 FROM DISK = 'E:Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\Patra_backup_201203052200.bak'
 WITH REPLACE, MOVE 'Patra' TO 'E:Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\data\Patra.mdf',
 MOVE 'Patra_log' TO 'E:Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\data\Patra_log.ldf'

Msg 28102, Level 16, State 1, Line 2
Batch execution is terminated because of debugger request.
Msg 3154, Level 16, State 4, Line 2
The backup set holds a backup of a database other than the existing 'Patra' database.
Msg 3013, Level 16, State 1, Line 2
Comment
Watch Question

Software Engineer
CERTIFIED EXPERT
Top Expert 2011
Commented:
Using the wizard you have to go to the options page and specify overwrite existing database.

Author

Commented:
I have done that on 2005 and 2008 and still receive the same error.  I have attached a screenshot and you can see the checkbox is marked.
pic.jpg
Paul JacksonSoftware Engineer
CERTIFIED EXPERT
Top Expert 2011

Commented:
Ensure your destination paths are correct you seem to be missing the \ after the E: in the above tsql.
Paul JacksonSoftware Engineer
CERTIFIED EXPERT
Top Expert 2011

Commented:
Only other workaround I can think of, is to backup the target database, then delete it and then restore your database backup.

Author

Commented:
thanks.  didn't work.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.