Make Network Path Visible For SQL Server Backup and Restore in
Make Network Path Visible For SQL Server Backup and Restore in
By: Ahmad Yaseen (/sqlserverauthor/145/ahmad-yaseen/) | Updated: 2015-03-03 | Comments (41) | Related: More
(/sql-server-dba-resources/) > Restore (/sql-server-tip-category/202/restore/)
Problem
The SQL Server Business Intelligence team (/sql-server-business-intelligence-resources/) at work wanted a copy of the live
Data Warehouse database to be restored (/sql-server-tip-category/202/restore/) to their Development SQL Server by replacing
the existing database for testing purposes. Checking the Development SQL Server data drive, there was no free space to fit
both the database and the backup files. Extending the drive or adding a new drive was not a valid option. What do I do?
Solution
The SQL Server Business Intelligence team (/sql-server-business-intelligence-resources/) wanted to restore (/sql-server-tip-
category/202/restore/) the database using SQL Server Management Studio (SSMS) (/sqlservertutorial/121/restore-sql-server-
database-and-overwrite-existing-database/), so the best choice that we found was to use a network drive on another server to
restore the database. When they used SQL Server Management Studio to browse for the network drive they could only see the
local drives. In this tip we show how to see other drives to be able to do the restore when using SSMS.
When you try to browse the backup files from SQL Server Management Studio, you will find only the local drives are shown as
shown below:
(/) MENU
Then to identify that network drive in SQL Server, you will use the xp_cmdshell command. Before that, you need to make sure
that the xp_cmdshell command is enabled in your SQL instance, as it is disabled by default. Use the sp_configure command to
enable it as shown below:
Now define that share drive for SQL with the xp_cmdshell command as follows:
It should now be mapped. In order to verify the new drive, you can use the below command that will show you all files in that
newly mapped drive:
EXEC XP_CMDSHELL 'Dir H:' MENU
(/)
Let’s try to use SQL Server Management Studio again to browse the path. As we can see below, we can now see the H: drive:
Now that he drive is visible, you can proceed normally with the restore process.
(/) MENU
Also you can backup any database to that network path as it is now visible to SQL Server from SSMS.
Next Steps
• Review SQL Server Backup Tips (/sql-server-tip-category/161/backup/)
• Review SQL Server Restore Tips (/sql-server-tip-category/202/restore/)
• Read more about XP_CMDSHELL (/sqlservertip/2987/can-i-stop-a-system-admin-from-enabling-sql-server-xpcmdshell/)
Related Resources
• More SQL Server DBA Tips... (/sql-server-dba-resources/)
Follow
◦ Get Free SQL Tips (/get-free-sql-server-tips/?ref=GetFooterMenu)
◦ Twitter (https://twitter.com/mssqltips)
(/) MENU
◦ LinkedIn (https://www.linkedin.com/groups/2320891/)
◦ Facebook (https://www.facebook.com/mssqltips/)
◦ Pinterest (https://www.pinterest.com/mssqltips/)
◦ RSS (https://feeds.feedburner.com/MSSQLTips-LatestSqlServerTips)
Learning Resources
◦ DBAs (/sql-server-dba-resources/) ◦ Tutorials (/sql-server-tutorials/)
◦ Developers (/sql-server-developer-resources/) ◦ Webcasts (/sql-server-webcasts/)
◦ BI Professionals (/sql-server-business-intelligence-resources/) ◦ Whitepapers (/sql-server-whitepapers/)
◦ Careers (/sql-server-professional-development-resources/) ◦ Tools (/sql-server-tools/)
Search Community
◦ Tip Categories (/sql-server-categories/) ◦ First Timer? (/learn-more-about-mssqltips/)
◦ Search By TipID (/search-tip-id/) ◦ Pictures (/mssqltips-community/1/)
◦ Authors (/sql-server-mssqltips-authors/) ◦ Contribute (/contribute/)
◦ Event Calendar (/sql-server-event-list/)
◦ User Groups (/sql-server-user-groups/)
◦ Author of the Year (/mssqltips-author-of-year/)
More Info
◦ Join (/get-free-sql-server-tips/?ref=JoinFooterMenu)
◦ About (/about/)
◦ Copyright (/copyright/)
◦ Privacy (/privacy/)
◦ Disclaimer (/disclaimer/)
◦ Feedback (/feedback/)
◦ Advertise (/advertise/)
Copyright (c) 2006-2020 Edgewood Solutions, LLC (https://www.edgewoodsolutions.com) All rights reserved
Some names and products listed are the registered trademarks of their respective owners.