Can Backup 5 restore to new database?

Forum for users of Red Gate SQL Backup tool

Moderator: Chris Auckland

Can Backup 5 restore to new database?

Postby mrn242 » Fri Oct 15, 2010 4:14 pm

Is there a way to restore to a new - or even a different - database using SQL Backup 5?
mrn242
 
Posts: 2
Joined: Mon Aug 30, 2010 6:52 pm

Postby petey » Sat Oct 16, 2010 4:28 am

Yes. If you want to use the same database files as the original database, omit the MOVE options e.g.

Code: Select all
EXEC master..sqlbackup '-sql "RESTORE DATABASE AdventureWorks_copy FROM DISK = [g:\\backups\\AdventureWorks.sqb]"'

If you want to create new database files, use the MOVE options e.g.

Code: Select all
EXEC master..sqlbackup '-sql "RESTORE DATABASE AdventureWorks_copy FROM DISK = [g:\\backups\\AdventureWorks.sqb] WITH MOVE [AdventureWorks_dat] TO [e:\\sqldata\\AdventureWorks_copy.mdf], MOVE [AdventureWorks_log] to [e:\\sqldata\\AdventureWorks_copy.ldf]"'
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm


Return to SQL Backup Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests