170

I have a SQL Server 2012 database with filestream enabled. However, when I backup it and try to restore it on another SQL Server 2012 instance (on another machine), I simply get this message that:

No backupset selected to be restored.

Not even a single line of more explanation. What's wrong here?

Every other database without filestream is OK and can be restored successfully. Is it something related to filestream? Should I install a hotfix or something like that.

8
  • 1
    Hasn't solved it yet. Seems that SQL Server configuration has problems. I think things should be more easier than this. Commented Aug 25, 2012 at 7:50
  • 1
    Can you provide the T-SQL that you're using to attempt the restore?
    – Ben Thul
    Commented Aug 25, 2012 at 13:14
  • 3
    Well, I'm using the GUI of SSMS. Commented Aug 26, 2012 at 3:50
  • Even doing it that way, there should be a "script" button somewhere near the top of the window. After you set everything up the way you think it would be set for the restore, hit that instead of "ok" and it will bring up the T-SQL that would be run against the server for the restore.
    – Ben Thul
    Commented Aug 26, 2012 at 15:08
  • 1
    Was permissions issue for me as well with SQL 2014 Standard (standalone) on WS 2012 R2 (workgroups) but had to reboot twice for the permissions 'take.' For what that's worth.. Hope you all get solved as well.
    – BaldEagle
    Commented Jul 27, 2014 at 18:40

21 Answers 21

200

I had this problem and it turned out I was trying to restore to the wrong version of SQL. If you want more information on what's going on, try restoring the database using the following SQL:

RESTORE DATABASE <YourDatabase> 
FROM DISK='<the path to your backup file>\<YourDatabase>.bak'

That should give you the error message that you need to debug this.

6
  • What error message do you get when you try the restore using the SQL above?
    – user489998
    Commented Aug 29, 2012 at 9:20
  • Seems that restoring DB using T-SQL script would do the work. I think because we haven't backed-up the filestream data, UI can't handle it. Commented Nov 5, 2012 at 12:07
  • 1
    Nice, I like the raw SQL approach. I get a message like ` The media set has 2 media families but only 1 are provided. All members must be provided.` -- does this mean that the backup source was different SQL Server version than backup target? When I try with the UI approach ("Restore"), I get message @ top No backupset selected to be restored. Commented Apr 27, 2017 at 16:50
  • OK, I guess "The media set has 2 media families" is discussed here; Commented Apr 27, 2017 at 17:43
  • 1
    If you want to replace the existing database completely use the WITH REPLACE option RESTORE DATABASE <YourDatabase> FROM DISK='<the path to your backup file>\<YourDatabase>.bak' WITH REPLACE Commented Aug 23, 2018 at 11:36
66

My problem ended up being permissions. I'm on a dev machine and copied via Homegroup. Somehow, probably based on where I copied the file to, the permissions got messed up and Management Studio couldn't read the file. Since this is dev I just gave Everyone permissions to the bak file and could then successfully restore via the GUI.

3
  • This ended up working for me too. It's SO DUMB that my username can have permissions to that folder, but the only way to get this to work was to add the group "Everyone" to the permissions on the folder. So frustrating, but thanks for saving me time! Commented Sep 23, 2013 at 13:06
  • 1
    Booya! Gotta love those generic errors that don't tell you anything. Of course it was permissions. Happened to me when restoring from sql servers on different domains. Changed the .bak file permission to everyone. Worked fine after that.
    – Prescient
    Commented Feb 14, 2018 at 15:13
  • Had experienced same issues when trying to restore database from .bak file, which was created by file upload web service, which is running under IIS ApplicationPoolIdentity
    – apdevelop
    Commented Jun 12, 2020 at 15:16
32

When running:

RESTORE DATABASE <YourDatabase> 
FROM DISK='<the path to your backup file>\<YourDatabase>.bak'

It gave me the following error:

The media family on device 'C:\NorthwindDB.bak' is incorrectly formed. SQL Server cannot process this media family. RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241) Blockquote

Turns out You cannot take a DB from a Higher SQL version to a lower one, even if the compatibility level is the same on both source and destination DB. To check the SQL version run:

Select @@Version

To see the difference, just create a DB on your source SQL server and try to do a restore from your backup file, when you do this whit SSMS, once you pick the backup file it will show some info about it as opossed to when you open it from a lower version server that will just say "no backupset selected to be restored" enter image description here

So if You still need to move your data to a lower version SQL then check This.

6
  • so if I take a db backup from machine with sql server 2014 enterprise - can it be restored on sql server 2014 express?
    – chester89
    Commented Sep 12, 2017 at 9:47
  • @chester89 I think it depends of what kind of functionality you have in the DB. And the kind of backup. The express version does not recognize compress backups. Also, if the enterprise version is using something unique to enterprise the free version (express) will not recognize it. But, if you have something standard, theoretically it should be recognized. Commented Sep 13, 2017 at 6:14
  • @JuanAcosta yep, I put that together. In my case, there's no enterprise-specific functionality in use, so I restored the backup without problems
    – chester89
    Commented Sep 13, 2017 at 7:10
  • @JuanAcosta can you point me to a documentation that says express edition can't restore compressed backup?
    – chester89
    Commented Sep 13, 2017 at 7:16
  • @Chester please check page 234 point 3. The default option is the only one avaiable in express version. books.google.com.au/… Commented Sep 14, 2017 at 8:24
16

Run SQL Server Management Studio as an administrator (right-click the shortcut/exe, then select "Run as Administrator"), then try to restore.

0
11

I thought I was not stupid enough to mix up the versions - however, I didn't realize that on my new server, a SQL Server 2005 instance was already installed from birth named SQLEXPRESS. When trying to restore my SQL Server 2008 R2 backed up database in SSMS 2012 to the SQLEXPRESS instance, the list of backup sets was empty.

Eventually I realized that the SQLEXPRESS instance on the server was not a 2012 instance, but a 2005. I disconnected and connected to the actual 2012 instance (in my case named SQLEXPRESS2012), and it (obviously) worked.

3
  • 2
    This pointed me in the right direction for my problem. I received the same error as the original poster but it was because I was attempting to restore a backup from SQL Express 2012 to a SQL Server 2008 instance. Understandably this is not advisable, unfortunately the error wasn't descriptive enough to get at the root problem.
    – LeastOne
    Commented Feb 4, 2014 at 19:34
  • 1
    Wow! I've installed too many hot-fixes from the site but that error didn't went away. I saw this answer and logged with Sql Server 2012 instance and tried to restore, IT WORKED! Huh thank you :)
    – Ali Baig
    Commented Sep 28, 2015 at 10:39
  • 1
    So you saying you cant restore from full version to express version? Commented Dec 7, 2015 at 17:02
8

My problem was that my user was in the Builtin-Administrators group and no user with Sysadmin-role on SQL Server. I just started the Management Studio as Administrator. This way it was possible to restore the database.

1
7

FYI: I found that when restoring, I needed to use the same (SQL User) credentials to login to SSMS. I had first tried the restore using a Windows Authentication account.

7

In my case, it was permissions and the fact that I used "Restore Files and Filegroups..." rather than simply "Restore Database ...".

That made the difference.

enter image description here

7

For me it's a user privilege issue. I logged-in with sa user and its working fine.

6

For me the problem was having the .BAK file located in an encrypted folder on the server. Even with full Admin rights, I could never get SSMS to read the file. Moving the .BAK to an unencrypted folder solved my problem. Note that after moving the file you may have to also change the properties on the actual file to remove encryption (right click, properties, advanced, uncheck "encrypt contents to secure data".

5

In my case (new sql server install, newly created user) my user simply didn't have the necessary permission. I logged to the Management Studio as sa, then went to Security/Logins, right-click my username, Properties, then in the Server Roles section I checked sysadmin.

4

I had the same issue with SQL Server 2014 (Management Studio could not see the folder in which the backup file resided, when attempting to locate it for a Restore operation). This thread held the answer that solved my problem. Quote:

The SQL Server service account can be found by Start->Control Panel->Administrative Tools->Services. Double-click on the SQL Server service->Log On tab. You'll either be using the "Local System account" or "This account" to define a specific account. If you are using the Local System account, you won't be able to reference backups that are not local to the server. If, instead, you have defined the account to use, this is the account that needs to have access to the backup file location. Your ability to access the backups using your personal logon is irrelevant; it is the SQL Server account that is used, even though you are initiating the backup. Your IT people should be able to determine what rights are granted to each account.

Hope that helps someone.

0
3

For me, it was because the backup file was still open by another process. Here's the event log:

BackupDiskFile::OpenMedia: Backup device 'X:\Backups\MyDatabase\MyDatabase_backup_2014_08_22_132234_8270986.bak' failed to open. Operating system error 32(The process cannot access the file because it is being used by another process.).

Simply closing and reopening Sql Server Management Studio resolved it (so obviously it was ssms.exe that had the handle..)

3

In my case, it was a permissions issue.

enter image description here

For the Windows user, I was using did not have dbcreator role.

So I followed the below steps

  1. Connect as sa to the SQL server
  2. Expand Security in Object Explorer
  3. Expand Logins
  4. Right click on the Windows user in question
  5. Click on Properties
  6. Select Server Roles from Select a page options
  7. Check dbcreator role for the user
  8. Click OK

enter image description here

1

Another potential reason for this glitch appears to be Google Drive. Google Drive is compressing bak files or something, so if you want to transfer a database backup via Google Drive, it appears you must zip it first.

1

If you want to replace the existing database completely use the WITH REPLACE option:

RESTORE DATABASE <YourDatabase> 
FROM DISK='<the path to your backup file>\<YourDatabase>.bak'
WITH REPLACE
0

Using SQL Server 2012 Express.

My error (from the SQL Manager - Restore Database Dialog):

No backupset selected to be restored

Further, there were no backupsets shown in the list to select.

The issue was that I had moved 1 of the 5 backup files to a folder where the SQL Server service logon user did not have permissions - I tried to add that user, but could not get the NT Service\MSSQL$SQLEXPRESS user into the security list.

I moved the file under the Documents folder for the service user, and that enabled it to read all the files I had selected - 4 at that point - and the error changed to "media set missing" - then I looked around for another backup file, and when I added that I was able to restore.

The answers in this question helped me look in the right places and work my way to a solution.

0

For me, It was a permission issue. I installed SQL server using a local user account and before joining my companies domain. Later on , I tried to restore a database using my domain account which doesn't have the permissions needed to restore SQL server databases. You need to fix the permission for your domain account and give it system admin permission on the SQL server instance you have.

0

I got the same error message even though I backup and restore on the same single machine.

The issue was from here: when backup, i had 2 item in the destination box.

So the fix would be: make sure only 1 item in the 'destination' box. Remove all the others if there are.

0

I have run into the same issue. Run SSMS as administrator then right click and do database restore. Should work.

0

I think I get the award for the most bone headed reason to get this error. In the Restore Database dialog, the database dropdown under Source is gray and I thought it was disabled. I skipped down to the database dropdown under Destination thinking it was the source and made a selection. Doing this will cause this error message to be displayed.

Not the answer you're looking for? Browse other questions tagged or ask your own question.