3

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

2
  • 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? Commented Mar 27, 2013 at 10:54
  • The destination directory for the backup command should be a local directory of the remote server. Commented Mar 27, 2013 at 10:54

1 Answer 1

3
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)

Sign up to request clarification or add additional context in comments.

12 Comments

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
Probably the Server.MapPath doesn't resolve correctly. Could you check the output of that command when executing the backup?
I also used UNC path, but with no luck
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.
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?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.