Rauf
Rauf

Reputation: 12852

Backup and restore from a network

I can login to SQL Server installed on 'Machine A'. Now I need to Backup a database(say 'DB_A') of the 'Machine A' to my local disk, so that I can Restore the database to my machine's SQL Server. I tried this, but gets errors.

Upvotes: 3

Views: 6073

Answers (3)

Rauf
Rauf

Reputation: 12852

I could do it. I did the following

  1. Create a folder in your PC, say MySharedDB.

  2. Set folder permissions as follows

    enter image description here

  3. Then in Backup screen of SSMS add the UNC path \\rauf\MySharedDB to Destination

Upvotes: 1

Christian Specht
Christian Specht

Reputation: 36441

As marc_s already said, SQL Server can only backup to local drives or to UNC paths.
If you do the backup with SQL Server Management Studio, you can only backup to local folders, nowhere else.
To backup to an UNC path, you need to do the backup via T-SQL:

So you would need to create a shared folder on your machine, and do the backup from the server via T-SQL.
On the other hand - you don't need to create the shared folder on your machine. You can backup the server to any shared folder and restore from there.
Or you could create the backup locally on the server, make the backup folder on the server a shared folder, and restore the backup from there directly onto your machine.

Upvotes: 1

marc_s
marc_s

Reputation: 755043

You cannot directly do this.

SQL Server will only backup its data to locally attached drives on the server machine - or to a network UNC path that the SQL Server machine can access and has permissions to write to.

With that: of course, if you create a shared folder on your local machine, and have all the permissions setup correctly, then the SQL Server backup could write into that shared folder on your local machine. That would be the way to get a remote server's backup onto your local harddisk.

Upvotes: 3

Related Questions