Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
After database backup, the created .bak files are not found in the save location in the actual server, for example I save it in this path:
C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Backup
But when I navigate to that folder written above, the folder is empty. This is the same server that has the database.
But when I try to restore the .bak file using SSMS I can see the database files.

What I have tried:

When I execute the below query, It shows the backup files and location.
<pre>SELECT *
FROM msdb.dbo.backupmediafamily


Please help im kinda lost.. :(
Posted
Updated 20-Nov-20 22:11pm
v3
Comments
Afzaal Ahmad Zeeshan 2-Feb-17 4:55am    
So it works, or it does not work? Your question is a bit unclear.
RedDk 21-Nov-20 12:47pm    
I just read OG's answer and what he says sounds like it's about right but I'd paraphrase a little by adding that in my experience MOST SQL Server "disconnects" (I use the term both amusingly and in a psychological sense) are related to file/folder sharing and system security settings, usually for the local drives, but not limited to that part of the machine, and antivirus programs that ALLOW remote access or disallow as the case might be.

Here's what I do to sleuth disconnects due to these things. First and foremost, don't try to do anything monumental like backup an instance that's as huge as an entire drive. Why? Because it takes TIME! Start by looking at subsets of SQL Server data. Create a tiny database! Run the same thing that you did when you came to the current impasse on THAT.

One main idea behind developing a program through coding is putting YOUR CODE through it's paces (as if a novice could walk to begin with, right?). The idea that you're going to jump into doing anything using someone elses code is ludicrous.

Start small and MAKE IT FAIL. Get it?

Good.

That's because SQL Server is a Server based product: it stores backup files relative to its server installation folder, not on your local PC. SSMS tells SQL Server to do a backup or restore, and it looks in it's appropriate folder to find the files. You can change the folder in SQL Server from SSMS by right-clicking the server name in the Object Explorer pane and selecting "Properties". In the resulting dialog, select the "Database settings" on the left and the default locations are towards the bottom of the right hand pane.

But ... you can only backup to folders that the SQL Server PC has access to - so if you want them on your machine you will have to share a folder, and connect to it from the server end.
 
Share this answer
 
Comments
berrymaria 2-Feb-17 21:21pm    
Hi Sir. Thank you for your answer. I'm doing the backup in the actual server Sir, after saving it in the drive in the actual server I cannot see it when I open the location to where I save it. I research it in google and it says about permission issues. I tried their solution but it seems nothing works for me. :(
I had the same issue. I was struggling for several days trying many things but nothing helped. Somehow, I finally found the solution which turned out to be quite easy.
So,
1st, you need to create a folder in you (C:) Drive. Create just one empty folder.
Then when you are making back up in SQL, REMOVE previous location, and click ADD button. And there you choose the folder you created in (C:). Choose it and then fill the "file name" gap. There you should write new name, not the database name, just create some random name. You should add: .bak when you write the name.
Save the name, and click OK. That's it.
Back up is successful!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900