Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
spalla
Starting Member
2 Posts |
Posted - 2007-12-05 : 13:35:41
|
I need to programmatically (C# w/ smo) backup a database on one SQL server and restore the backup on a different SQL server. The problem I have is that I cannot guarantee that either SQL Server is running as a domain user (either one may be running as Local System). This results in "Access Denied" errors when attempting to backup to (or restore from) a spot one of the servers cannot see. In this situation, is there any way to programmatically backup and restore an entire database from one SQL server to another?(I've seen the thread about backing up to a network drive which leads me to believe that backup/restore will not work for me if the SQL server is running as LocalSystem.)Thanks. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-12-05 : 13:48:49
|
Your application connection string(s) will need to use Windows authentication with an account that has all of the permissions needed for this process. In your application, you could backup the database to the local disk, copy that file to the other server using a UNC path, then restore the database. None of this requires anything special from the service account(s).Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
|
|
spalla
Starting Member
2 Posts |
Posted - 2007-12-05 : 14:43:28
|
If I understand correctly, you are suggesting I just copy the backup file myself (i.e., via my application) from the first sql server to the second sql server, thus taking the sql server service account permissions out the equation?Thanks. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-12-05 : 14:57:06
|
Yes.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|