Restoring a backed-up LocalDB database

Restoring a LocalDB database is similar to restoring a normal SQL database using the SQL Server Management Studio. However, you might encounter an error during the process:

Database restore error

“Property BackupDirectory is not available for Settings ‘Microsoft.SqlServer.Management.Smo.Settings’. This property may not exist for this object or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo).”

These steps provide a solution to this problem. We assume that you have created a backup of your database using the Hotfix and Upgrade Utility.

  1. Open the Registry editor and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11E.LOCALDB\MSSQLServer.

  2. Add these three String Values with the path to your backed-up folder as a value:

    • DefaultData
    • DefaultLog
    • BackupDirectory

    Add these registry keys

  3. Open Microsoft SQL Server Management Studio

  4. Connect to the LocalDB instance, use the server name: (localdb)\Kentico
    Connect to LocalDB

  5. Delete the old database.

  6. Right-click the Databases folder and select Restore Database…. Select Restore Database

  7. In the Source section, select Device.

  8. Click the () button.

  9. Click Add.

  10. Select the database backup file (.bak) and click OK.
    Select the database backup file

  11. Click OK to begin the restore process.

The system now restores your LocalDB database.