Restore database backup over the network Restore database backup over the network database database

Restore database backup over the network


You have few options to use a network file as a backup source

  1. Map network drive/path, hosting file, under SAME user as MS-SQL Server.
  2. Use xp_cmdshell extended stored procedure to map network drive from inside of MS SQL (such way, command shell will have the same privilegies as the user account running SSMS)
-- allow changes to advanced options EXEC sp_configure 'show advanced options', 1GO-- Update currently configured values for advanced options.RECONFIGUREGO-- To enable xp_cmdshellEXEC sp_configure 'xp_cmdshell', 1GO-- Update currently configured values for advanced options.RECONFIGUREGOEXEC xp_cmdshell 'NET USE Z: \\Srv\Path password1 /USER:Domain\UserName'

Afterwards drive Z: will be visible in Server Managment studio, or just

RESTORE DATABASE DataBaseNameHere FROM DISK = 'Z:\BackNameHere.BAK'GO


The database is often running as a service under an account with no network access. If this is the case, then you wouldn't be able to restore directly over the network. Either the backup needs to be copied to the local machine or the database service needs to run as a user with the proper network access.


You cannot do this through the SSMS GUI, but you can do it using a script. RESTORE DATABASE from DISK='\unc\path\filename' If you need this process automated, the best way is to setup a SQL Server Job and run it as a user with access to the file location.