I am trying to restore the DB on a raspberry pi. I have deleted all the nzbdrone.db* files and I have also checked with sqlite3 that my DB is not corrupt. However when I launch Sonarr it fails because it tries to create tables which already exist (e.g. CREATE TABLE Config fails because table already exists).
Is there a way to force Sonarr to use the tables already in the DB instead of trying to recreate them?
18-6-5 19:36:57.8|Info|Bootstrap|Starting Sonarr - /opt/NzbDrone/NzbDrone.exe - Version 2.0.0.5163
18-6-5 19:37:08.4|Info|Router|Application mode: Interactive
18-6-5 19:37:11.4|Info|MigrationLogger|*** Migrating data source=/home/osmc/.config/NzbDrone/nzbdrone.db;cache size=-10485760;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***
18-6-5 19:37:14.4|Info|MigrationLogger|*** 1: InitialSetup migrating ***
18-6-5 19:37:14.5|Info|InitialSetup|Starting migration to 1
18-6-5 19:37:15.2|Error|MigrationLogger|System.Exception: SQL logic error or missing database
table “Config” already exists
While Processing:
“CREATE TABLE “Config” (“Id” INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, “Key” TEXT NOT NULL, “Value” TEXT NOT NULL)” —> System.Data.SQLite.SQLiteException: SQL logic error or missing database
table “Config” already exists
at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, System.UInt32 timeoutMS, System.String& strRemain) [0x0033c] in <61a20cde294d4a3eb43b9d9f6284613b>:0
at System.Data.SQLite.SQLiteCommand.BuildNextCommand () [0x00068] in <61a20cde294d4a3eb43b9d9f6284613b>:0
— End of inner exception stack trace —
at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.ExecuteNonQuery (System.String sql) [0x0003e] in <137fb96feee44f379d6a8fba4e172d1c>:0
at FluentMigrator.Runner.Processors.SQLite.SQLiteProcessor.Process (System.String sql) [0x0003f] in <137fb96feee44f379d6a8fba4e172d1c>:0
at FluentMigrator.Runner.Processors.ProcessorBase.Process (FluentMigrator.Expressions.CreateTableExpression expression) [0x0000d] in <137fb96feee44f379d6a8fba4e172d1c>:0
at FluentMigrator.Expressions.CreateTableExpression.ExecuteWith (FluentMigrator.IMigrationProcessor processor) [0x00000] in :0
at FluentMigrator.Runner.MigrationRunner+<>c__DisplayClass72_0.b__1 () [0x00011] in <137fb96feee44f379d6a8fba4e172d1c>:0
at FluentMigrator.Runner.StopWatch.Time (System.Action action) [0x00006] in <137fb96feee44f379d6a8fba4e172d1c>:0
at FluentMigrator.Runner.MigrationRunner.AnnounceTime (System.String message, System.Action action) [0x0000c] in <137fb96feee44f379d6a8fba4e172d1c>:0
at FluentMigrator.Runner.MigrationRunner.ExecuteExpressions (System.Collections.Generic.ICollection`1[T] expressions) [0x0006c] in <137fb96feee44f379d6a8fba4e172d1c>:0