dbTalk Databases Forums  

Backup 1 DB, Restore to a different DB

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Backup 1 DB, Restore to a different DB in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AJ
 
Posts: n/a

Default Backup 1 DB, Restore to a different DB - 08-21-2006 , 03:36 PM






Hello,

Every night, I would like a job to backup our production database and
restore it to another database. The second database is to be used for
testing, but we want to keep the data the most current. Does anyone know if
this is possible to do? We tried doing an export, but it takes way too long.

Any suggestion is very appreciated.

Thanks!

Reply With Quote
  #2  
Old   
AJ
 
Posts: n/a

Default RE: Backup 1 DB, Restore to a different DB - 08-21-2006 , 04:18 PM






Now I have something, but I get an error that I need to use WITH REPLACE, but
I can't find the syntax for WITH REPLACE.

Here is what I am doing:


BACKUP DATABASE Northwind
TO DISK = '\\jd\d$\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\Northwind.bak'
RESTORE FILELISTONLY
FROM DISK = '\\jd\d$\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\Northwind.bak'
RESTORE DATABASE TestDB
FROM DISK = '\\jd\d$\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\Northwind.bak'
WITH MOVE 'Northwind' TO '\\jd\d$\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\test\testdb.mdf',
MOVE 'Northwind_log' TO '\\jd\d$\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\test\testdb.ldf'
GO

Here is the error:


Server: Msg 3141, Level 16, State 1, Line 5
The database to be restored was named 'Northwind'. Reissue the statement
using the WITH REPLACE option to overwrite the 'TestDB' database.
Server: Msg 3013, Level 16, State 1, Line 5
RESTORE DATABASE is terminating abnormally.






"AJ" wrote:

Quote:
Hello,

Every night, I would like a job to backup our production database and
restore it to another database. The second database is to be used for
testing, but we want to keep the data the most current. Does anyone know if
this is possible to do? We tried doing an export, but it takes way too long.

Any suggestion is very appreciated.

Thanks!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.