H. Aghassi
H. Aghassi

Reputation: 231

Sql Server restore/backup database from remote client programmatically

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?

Upvotes: 5

Views: 8113

Answers (3)

H. Aghassi
H. Aghassi

Reputation: 231

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.

Upvotes: 6

Dennis
Dennis

Reputation: 37760

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.

Upvotes: 2

Rajesh Subramanian
Rajesh Subramanian

Reputation: 6490

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.

Upvotes: 0

Related Questions