Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restore SQL Server 2008 R2 backup to a LocalDb 2012

I have a backup of a database (.bak) created ​​in SQL Server 2008 R2.

To test some features, like to import this backup to LocalDB (2012). When I click on Restore and select the database the following error occurs:

Property MasterDBLogPath is not available for Information 'Microsoft.SqlServer.Management.Smo.Information'. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)

like image 441
ridermansb Avatar asked Mar 09 '13 14:03

ridermansb


1 Answers

You need to add the following 3 registry keys (run/regedit):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11E.LOCALDB\MSSQLServer\DefaultData,

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11E.LOCALDB\MSSQLServer\DefaultLog, 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11E.LOCALDB\MSSQLServer\BackupDirectory

With an existing folder name as value (where you have write access), e.g. "C:\Databases".

Please have a look at the excellent walkthrough under http://www.roelvanlisdonk.nl/?p=2896 (which is where I have copied the answer from).

like image 74
Felix Zumstein Avatar answered Sep 27 '22 18:09

Felix Zumstein