0

Does SQL Server 2008+ support symbolically linked directories when making backups and restoring DBs?

My own test made use of a mapped network drive, which I made it appear by symbolically linking it as a local backup directory. I attempted to make a backup of a database to this symbolic link but received an error in SSMS (SQL Server Management Studio) stating that it was "unable to open the backup device".

Answer: Yes, SQL Server supports symbolic links, even over network shares provided SQL Server has the necessary permissions to access the network share.

1 Answers1

2

Your issue has nothing to do with symbolic links; a mapped network drive only exists in the context of the user who mapped it: SQL Server runs in a completely different user context (unless you're running it under your own user account, which I don't think is the case), thus it simply can't see the same network drives you see.

Massimo
  • 70,200
  • 57
  • 200
  • 323
  • Okay, confirmed. I changed SQL Server Engine to run on the same user credential I mapped the drive with and it works. – TheLegendaryCopyCoder Mar 24 '17 at 14:05
  • 2
    That's probably the worst possible solution. You should run SQL Server under a domain account which has access to the network share, or run it as Network Service and give permissions on the share to the machine account of the computer where SQL Server runs. – Massimo Mar 24 '17 at 14:08
  • 2
    Also, you don't need a mapped drive (and/or symbolic links): SQL Server is perfectly able to use UNC paths. – Massimo Mar 24 '17 at 14:09
  • I get what you were saying. This was just a prototype/test, its being handed over to the Architects to figure out the final solution. – TheLegendaryCopyCoder Jun 04 '18 at 11:30