5

I want to backup and restore my database that is in the server from my client Desktop application in C#. I already found some sample code that do backup/restore programmatically, however it backups on the server computer and restores just from the server computer. The users should be able to select the backup files from client by the client application or create backup files in the client computers.

How can I do backup/restore remotely?

3
  • hope this link helps : dotnetfunda.com/articles/… Commented Jun 27, 2012 at 5:46
  • thanks Boomer! it just uses typical sharing folder. I want to do it programmatically without changing all client OS settings. Commented Jun 27, 2012 at 5:51
  • You cannot restore a remote backup - the *.bak file has to be on the machine you're restoring to - either directly on a local disk, or on a network share that machine has access to. Commented Jun 27, 2012 at 6:23

3 Answers 3

6

I found a very useful method to backup remotely: http://www.codeproject.com/Articles/33963/Transferring-backup-files-from-a-remote-SQL-Server. However, the problem still exist for restoring remotely.

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

Comments

2

Make a share on the server. Then, copy backups there from the client machine, if you want to restore database, or copy backups to the client machine from there, if you want to store backup at the client.
Of course, client must have r/w permissions for this share.

Comments

0

Just an idea.

While Taking backup, Just store the backup file name and location in database table. So that you can show it to the user for recovery.

Still you can use database code restore with dynamic backup location argument.

Comments

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.