How do you restore a database backup using SQL Server 2005 over the network? I recall doing this before but there was something odd about the way you had to do it.
To back up to a network drive when SQL Server is running in a domain user account, the shared drive must be mapped as a network drive in the session where SQL Server is running. If you start Sqlservr.exe from command line, SQL Server sees any network drives you have mapped in your login session.
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.
You have few options to use a network file as a backup source
-- allow changes to advanced options EXEC sp_configure 'show advanced options', 1 GO -- Update currently configured values for advanced options. RECONFIGURE GO -- To enable xp_cmdshell EXEC sp_configure 'xp_cmdshell', 1 GO -- Update currently configured values for advanced options. RECONFIGURE GO EXEC 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With