I'm looking for a script to restore a SQL Server 2005 backup. Ideally the script will have the following features
- handle backup files on a network location
- Handle different file structure of source and destination server ("With MOVE"?)
- Written in PowerShell
Any suggestions?
Here's a link to a script I created
I'm using link text. Ok, is not really a Powershell script. But it works on all Servers, 2000 or 2005 so far. And it does a great job for me. Just executing master..usp_build_restore_script and copy the relevant part for the Restore.
I did also an extension in Powershell. As a sample, before i execute a Restore, i like to see if the necessary files really exists or not. For this i just execute the master..usp_build_restore_script from Powershell and use test-path on all Backupfiles.
Not sure about the different structures but this post at sqlmusings.com should be agood starting point for you.