I am trying to create a c# function that will backup and restore an mssql server 2005 db. I have tried almost everything on the net but I have no luck. On my local machine everything works perfect, but when I tried remotely I take the error:Operating system error 3... BACKUP DATABASE is terminating abnormally. Iam using Server.MapPath("~/mypath") for the path. I have also tried the following, with no luck: Tranferring backup files from a remote sql server
-
Can you provide the SQL it is running? How are you logging into the database server? If youre using a trusted connection does your user have permission to write to the backup location?Rob– Rob2013-03-27 10:54:14 +00:00Commented Mar 27, 2013 at 10:54
-
The destination directory for the backup command should be a local directory of the remote server.Steve– Steve2013-03-27 10:54:19 +00:00Commented Mar 27, 2013 at 10:54
Add a comment
|
1 Answer
Operating system error code 3(The system cannot find the path specified.).
You should use a local directory on the remote server to save the backup
(of course the user connected should have permission to reach that local directory)
12 Comments
Equilibrium
Thank you for the reply. I am using a public access directory. To test I am using the directory I host my site. For example Server.MapPath("~/john") John is a folder on my site
Steve
Probably the Server.MapPath doesn't resolve correctly. Could you check the output of that command when executing the backup?
Equilibrium
I also used UNC path, but with no luck
Steve
Well, something should be wrong on that path. SqlServer runs with a specific account like LOCALSYSTEM or NETWORKSERVICE, but if it was a permission problem then you should get an Error 5 Access denied.
Equilibrium
I am running the tests from a sub domain, but the Server.MapPath("~/john") finds exactly the directory. I can see this from the error I take. . The sub domain can cause the problem?
|