Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 211
H. Aghassi Avatar asked Jun 27 '12 05:06

H. Aghassi


People also ask

How do I restore a SQL Server database from another server?

Connect to the appropriate instance of the SQL Server Database Engine, and then in Object Explorer, select the server name to expand the server tree. Right-click Databases, and then select Restore Database. The Restore Database dialog box opens. Select the database to restore from the drop-down list.

How do I restore a SQL database from a backup?

Open Microsoft SQL Server Management Studio. In the left navigation bar, right-click on Databases and then click Restore Database. In the Source section, select Device and click the button with three dots. In the pop up window that opens, click Add and browse for your backup file.

How do you restore a database from full backup with overwrite option?

The RESTORE ... WITH REPLACE allows you to write over an existing database when doing a restore without first backing up the tail of the transaction log. The WITH REPLACE basically tells SQL Server to just throw out any active contents in the transaction log and move forward with the restore.

How do you restore a .BAK file to a new database?

Restore the database from a BAK fileRight-click on the database server in the left navigation pane, click Tasks, click Restore. The name of the restoring database appears in the To database list box. To create a new database, enter its name in the list box. Select 'From device'.


1 Answers

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.

like image 76
H. Aghassi Avatar answered Nov 15 '22 09:11

H. Aghassi