Share via


SQL How to add shared path directory for Backups ?

Question

Wednesday, July 11, 2018 4:59 AM

Hi,

I'm having an issue to backup the sql database. The problem is i want to backup the data to another shared drive path but sql is not giving me an option to add i have added manual added the path like (\10.10.10.220\shared$) but its not executing the command. How do i add the shared path directory ?

i only have one shared drive which is C: and have a very limited source of space also i don't want to create the backup in the same pc so req any solution to this problem. Thanks

All replies (11)

Wednesday, July 11, 2018 1:34 PM ✅Answered

In your screenshot, I do not see that you've used "\" prefix to the shared path (though you indicated to have used it in your question). Try and see if that fixes it.

Also, have you properly shared the backup folder under the C: drive? Is the share visible when you enter              \<hostname> in the windows explorer? If so, then the backup should work.

Also, there's no need to use '$' if you have shared a folder. You can directly use the path as highlighted in my second screenshot above.

Hope this helps!

Please remember to click "Mark as Answer" if my response answered your question or click "Vote as helpful" if it helped you in any way.


Thursday, July 12, 2018 6:32 AM ✅Answered

Hi,

Please check this, see if it works for you. 

https://blogs.msdn.microsoft.com/varund/2009/06/04/backup-and-restore-sql-server-database-to-a-network-shared-drive/ 

Also, there's another solution in the comments and you can make a reference.

Thanks,
Xi Jin.

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


Wednesday, July 11, 2018 5:05 AM

Does the executing account have access to the shared path you're specified? Otherwise you wont be able to access and write the backup file to it.

Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh

My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page


Wednesday, July 11, 2018 5:42 AM

Does the executing account have access to the shared path you're specified? Otherwise you wont be able to access and write the backup file to it.

Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh

My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Yes it does access to write to the directory I also mount a drive in Mycom but its not showing in the screen shot i have given above except C:


Wednesday, July 11, 2018 6:25 AM

Does the executing account have access to the shared path you're specified? Otherwise you wont be able to access and write the backup file to it.

Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh

My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Yes it does access to write to the directory I also mount a drive in Mycom but its not showing in the screen shot i have given above except C:

see

https://www.mssqltips.com/sqlservertip/3499/make-network-path-visible-for-sql-server-backup-and-restore-in-ssms/

Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh

My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page


Wednesday, July 11, 2018 7:28 AM

SSMS as tool don't support to select shares and when you mount a share as drive, then it's a drive for your profile and not available for SQL Server.

But plain T-SQL Statements for backup/restore support UNC path of Shares, so use plain T-SQL

Olaf Helper

[ Blog] [ Xing] [ MVP]


Wednesday, July 11, 2018 10:54 AM

Does the executing account have access to the shared path you're specified? Otherwise you wont be able to access and write the backup file to it.

Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh

My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Yes it does access to write to the directory I also mount a drive in Mycom but its not showing in the screen shot i have given above except C:

see

https://www.mssqltips.com/sqlservertip/3499/make-network-path-visible-for-sql-server-backup-and-restore-in-ssms/

Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh

My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

I did run all these commands but still map drive is not appeared ?


Wednesday, July 11, 2018 11:08 AM

still map drive is not appeared ?

Again, the drive is mapped for you private profile, it's not available for SQL Server. Use plain T-SQL backup command with UNC path.

Olaf Helper

[ Blog] [ Xing] [ MVP]


Thursday, July 12, 2018 8:20 AM

In your screenshot, I do not see that you've used "\" prefix to the shared path (though you indicated to have used it in your question). Try and see if that fixes it.

Also, have you properly shared the backup folder under the C: drive? Is the share visible when you enter              \<hostname> in the windows explorer? If so, then the backup should work.

Also, there's no need to use '$' if you have shared a folder. You can directly use the path as highlighted in my second screenshot above.

Hope this helps!

Please remember to click "Mark as Answer" if my response answered your question or click "Vote as helpful" if it helped you in any way.

Mohsin again thanks alot for the help, I had given the permission the earlier but some how it was removed i dunno how,  well i again applied permission to the folder i wast to dump the data and it works.. and for \ yeah i did try this also before might be the permission problem well it is resolved and working now. You all here are great people and love to see how you help me out. Thanks a lot everyone who post for me. :) cheers


Thursday, July 12, 2018 11:21 AM

Mohsin again thanks alot for the help, I had given the permission the earlier but some how it was removed i dunno how,  well i again applied permission to the folder i wast to dump the data and it works.. and for \ yeah i did try this also before might be the permission problem well it is resolved and working now. You all here are great people and love to see how you help me out. Thanks a lot everyone who post for me. :) cheers

Tayyabriaz,

Glad it worked out for you. On a different note, do you have any follow-up questions on this earlier thread of yours? If so, please feel free to ask. If you are satisfied with the any of the responses, could you please mark them as answers and close it out? That would lighten the load on Moderators :) Thanks!

Please remember to click "Mark as Answer" if my response answered your question or click "Vote as helpful" if it helped you in any way.


Thursday, July 26, 2018 8:53 AM

Mohsin again thanks alot for the help, I had given the permission the earlier but some how it was removed i dunno how,  well i again applied permission to the folder i wast to dump the data and it works.. and for \ yeah i did try this also before might be the permission problem well it is resolved and working now. You all here are great people and love to see how you help me out. Thanks a lot everyone who post for me. :) cheers

Tayyabriaz,

Glad it worked out for you. On a different note, do you have any follow-up questions on this earlier thread of yours? If so, please feel free to ask. If you are satisfied with the any of the responses, could you please mark them as answers and close it out? That would lighten the load on Moderators :) Thanks!

Please remember to click "Mark as Answer" if my response answered your question or click "Vote as helpful" if it helped you in any way.

Sorry for the delay. Done