diff --git a/Banshee.sln b/Banshee.sln
index e4a4439..56bfc99 100644
--- a/Banshee.sln
+++ b/Banshee.sln
@@ -144,6 +144,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.UbuntuOneMusicStore
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.OpticalDisc", "src\Extensions\Banshee.OpticalDisc\Banshee.OpticalDisc.csproj", "{F38B53BA-8F85-4DC6-9B94-029C1CF96F24}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.RecoverDatabase", "src\Extensions\Banshee.RecoverDatabase\Banshee.RecoverDatabase.csproj", "{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}"
+EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{4F47D6F1-4047-4A89-AE85-3AE5EF9F2961}"
 	ProjectSection(SolutionItems) = postProject
 	EndProjectSection
@@ -270,6 +272,16 @@ Global
 		{4FBB954A-5CA9-44DC-97DA-7D549AC3EADB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{4FBB954A-5CA9-44DC-97DA-7D549AC3EADB}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{4FBB954A-5CA9-44DC-97DA-7D549AC3EADB}.Windows|Any CPU.ActiveCfg = Windows|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Debug|x86.Build.0 = Debug|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Release|x86.ActiveCfg = Release|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Release|x86.Build.0 = Release|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Windows|Any CPU.ActiveCfg = Debug|Any CPU
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}.Windows|Any CPU.Build.0 = Debug|Any CPU
 		{5F696A8F-B216-4ECE-9E35-907DDFC760BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{5F696A8F-B216-4ECE-9E35-907DDFC760BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{5F696A8F-B216-4ECE-9E35-907DDFC760BD}.Windows|Any CPU.ActiveCfg = Windows|Any CPU
@@ -540,6 +552,7 @@ Global
 		{EE91126B-5500-4719-9FAA-36CBAC95DEE3} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
 		{3B855EBC-8E55-48DF-816B-B241BE45EBD8} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
 		{F38B53BA-8F85-4DC6-9B94-029C1CF96F24} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
+		{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
 		{95374549-9553-4C1E-9D89-667755F90E12} = {4F47D6F1-4047-4A89-AE85-3AE5EF9F2961}
 		{95374549-9553-4C1E-9D89-667755F90E13} = {4F47D6F1-4047-4A89-AE85-3AE5EF9F2961}
 		{C856EFD8-E812-4E61-8B76-E3583D94C233} = {4F47D6F1-4047-4A89-AE85-3AE5EF9F2961}
diff --git a/build/build.environment.mk b/build/build.environment.mk
index 9ccfa9c..ba62595 100644
--- a/build/build.environment.mk
+++ b/build/build.environment.mk
@@ -140,6 +140,7 @@ REF_EXTENSION_MINIMODE = $(LINK_BANSHEE_THICKCLIENT_DEPS)
 REF_EXTENSION_MEEGO = $(LINK_BANSHEE_THICKCLIENT_DEPS)
 LINK_EXTENSION_MEEGO = -r:$(DIR_BIN)/Banshee.MeeGo.dll $(REF_EXTENSION_MEEGO)
 REF_EXTENSION_MPRIS = $(LINK_BANSHEE_THICKCLIENT_DEPS)
+REF_EXTENSION_RECOVER_DATABASE = $(LINK_BANSHEE_THICKCLIENT_DEPS)
 REF_EXTENSION_MULTIMEDIAKEYS = $(LINK_BANSHEE_SERVICES_DEPS)
 REF_EXTENSION_FIXUP = $(LINK_BANSHEE_THICKCLIENT_DEPS) $(LINK_MUSICBRAINZ_DEPS) $(LINK_MIGO_DEPS)
 REF_EXTENSION_NOTIFICATIONAREA = $(LINK_BANSHEE_THICKCLIENT_DEPS)
diff --git a/configure.ac b/configure.ac
index 7740219..4743a18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -341,6 +341,7 @@ src/Extensions/Banshee.OpticalDisc/Makefile
 src/Extensions/Banshee.PlayQueue/Makefile
 src/Extensions/Banshee.PlayerMigration/Makefile
 src/Extensions/Banshee.Podcasting/Makefile
+src/Extensions/Banshee.RecoverDatabase/Makefile
 src/Extensions/Banshee.SoundMenu/Makefile
 src/Extensions/Banshee.SqlDebugConsole/Makefile
 src/Extensions/Banshee.Sample/Makefile
diff --git a/src/Extensions/Banshee.RecoverDatabase/Banshee.Recover/RecoverService.cs b/src/Extensions/Banshee.RecoverDatabase/Banshee.Recover/RecoverService.cs
new file mode 100644
index 0000000..fee76d7
--- /dev/null
+++ b/src/Extensions/Banshee.RecoverDatabase/Banshee.Recover/RecoverService.cs
@@ -0,0 +1,113 @@
+// 
+// RecoverService.cs
+// 
+// Author:
+//   Olivier Dufour <olivier.duff@gmail.com>
+// 
+// Copyright 2011 
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Gtk;
+
+using Hyena;
+using Hyena.Data.Sqlite;
+using Hyena.Widgets;
+
+using Banshee.ServiceStack;
+using Banshee.I18n;
+using Banshee.Gui;
+
+namespace Banshee.Recover
+{
+    public class RecoverService : IExtensionService, IDisposable
+    {
+        public RecoverService ()
+        {
+        }
+
+        void IExtensionService.Initialize ()
+        {
+            ServiceManager.DbConnection.DataBaseMalformed += RestoreDatabase;
+            // So when do we save DB?
+            // for moment only where we quit
+            Banshee.ServiceStack.Application.ShutdownRequested += OnShutdownRequested;
+        }
+
+        void IDisposable.Dispose ()
+        {
+            ServiceManager.DbConnection.DataBaseMalformed -= RestoreDatabase;
+            Banshee.ServiceStack.Application.ShutdownRequested -= OnShutdownRequested;
+        }
+
+        private bool OnShutdownRequested ()
+        {
+            SaveDatabase ();
+            return true;
+        }
+
+        private void RestoreDatabase (object sender, EventArgs args)
+        {
+            if (ConfirmUserAction ()) {
+                Banshee.IO.File.Copy (BackupDbUri, new SafeUri (ServiceManager.DbConnection.DbPath), true);
+            }
+        }
+
+        private void SaveDatabase ()
+        {
+            Banshee.IO.File.Copy (new SafeUri (ServiceManager.DbConnection.DbPath), BackupDbUri, true);
+        }
+
+        SafeUri BackupDbUri {
+            get { return new SafeUri (ServiceManager.DbConnection.DbPath + ".backup");}
+        }
+
+        string IService.ServiceName {
+            get { return "RecoverService"; }
+        }
+
+        internal static bool ConfirmUserAction ()
+        {
+            string header = Catalog.GetString ("Your database become corrupted.");
+            string message = Catalog.GetString ("Do you want to restore the last saved one?");
+
+            var md = new HigMessageDialog (
+                ServiceManager.Get<GtkElementsService> ().PrimaryWindow,
+                DialogFlags.DestroyWithParent, MessageType.Warning,
+                ButtonsType.None, header, message
+            );
+            md.AddButton ("gtk-cancel", ResponseType.No, true);
+            md.AddButton (Catalog.GetString ("Remove tracks"), ResponseType.Yes, false);
+
+            bool restore_db = false;
+            ThreadAssist.BlockingProxyToMain (() => {
+                try {
+                    if (md.Run () == (int) ResponseType.Yes) {
+                        restore_db = true;
+                    }
+                } finally {
+                    md.Destroy ();
+                }
+            });
+            return restore_db;
+        }
+    }
+}
+
diff --git a/src/Extensions/Banshee.RecoverDatabase/Banshee.RecoverDatabase.addin.xml b/src/Extensions/Banshee.RecoverDatabase/Banshee.RecoverDatabase.addin.xml
new file mode 100644
index 0000000..0120301
--- /dev/null
+++ b/src/Extensions/Banshee.RecoverDatabase/Banshee.RecoverDatabase.addin.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Addin
+    id="Banshee.RecoverDatabase"
+    version="1.0"
+    compatVersion="1.0"
+    copyright="© 2011 Olivier Dufour. Licensed under the MIT X11 license."
+    name="Recover database"
+    description="Auto save and recover sqlite database file."
+    author="Olivier Dufour"
+    category="Utilities"
+    defaultEnabled="true">
+
+  <Dependencies>
+    <Addin id="Banshee.Services" version="1.0" />
+  </Dependencies>
+
+  <Extension path="/Banshee/ServiceManager/Service">
+    <Service class="Banshee.Recover.RecoverService"/>
+  </Extension>
+
+</Addin>
diff --git a/src/Extensions/Banshee.RecoverDatabase/Banshee.RecoverDatabase.csproj b/src/Extensions/Banshee.RecoverDatabase/Banshee.RecoverDatabase.csproj
new file mode 100644
index 0000000..457d2bb
--- /dev/null
+++ b/src/Extensions/Banshee.RecoverDatabase/Banshee.RecoverDatabase.csproj
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.21022</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{58FAD7D7-75EC-4791-BAE4-4BDDEA6F138C}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>Banshee.RecoverDatabase</RootNamespace>
+    <AssemblyName>Banshee.RecoverDatabase</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <ReleaseVersion>1.3</ReleaseVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>none</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <ItemGroup>
+    <None Include="Banshee.RecoverDatabase.addin.xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Banshee.Recover\" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Banshee.Recover\RecoverService.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Core\Banshee.Core\Banshee.Core.csproj">
+      <Project>{2ADB831A-A050-47D0-B6B9-9C19D60233BB}</Project>
+      <Name>Banshee.Core</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\Core\Banshee.ThickClient\Banshee.ThickClient.csproj">
+      <Project>{AC839523-7BDF-4AB6-8115-E17921B96EC6}</Project>
+      <Name>Banshee.ThickClient</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\Hyena\Hyena.Data.Sqlite\Hyena.Data.Sqlite.csproj">
+      <Project>{95374549-9553-4C1E-9D89-667755F90E13}</Project>
+      <Name>Hyena.Data.Sqlite</Name>
+    </ProjectReference>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/src/Extensions/Makefile.am b/src/Extensions/Makefile.am
index 2f55441..71b8851 100644
--- a/src/Extensions/Makefile.am
+++ b/src/Extensions/Makefile.am
@@ -26,6 +26,7 @@ SUBDIRS = \
 	Banshee.PlayQueue \
 	Banshee.MeeGo \
 	Banshee.Podcasting \
+	Banshee.RecoverDatabase \
 	Banshee.Sample \
 	Banshee.SoundMenu \
 	Banshee.SqlDebugConsole \
diff --git a/src/Hyena b/src/Hyena
--- a/src/Hyena
+++ b/src/Hyena
@@ -1 +1 @@
-Subproject commit 2273ff3c52a75388e7e8aa8034d03e1bec1ec002
+Subproject commit 2273ff3c52a75388e7e8aa8034d03e1bec1ec002-dirty
