Migrating Sonarr DB

Sonarr version (exact version): 2.0.0.4613
Mono version (if Sonarr is not running on Windows):4.2.1
OS: Linux Mint Cinnamon 18.1
((Debug logs)):
[Info] Bootstrap: Starting Sonarr - /opt/NzbDrone/NzbDrone.exe - Version 2.0.0.4613
[Info] MigrationLogger: *** Migrating data source=/home/nathan/.config/NzbDrone/nzbdrone.db;cache size=-10485760;datetimekind=Utc;journal mode=Wal;pooling=True;version=3 ***

[Fatal] ConsoleApp: EPIC FAIL!

[v2.0.0.4613] NzbDrone.Core.Datastore.CorruptDatabaseException: Database file: /home/nathan/.config/NzbDrone/nzbdrone.db is corrupt, restore from backup if available. See: https://github.com/Sonarr/Sonarr/wiki/FAQ#i-am-getting-an-error-database-disk-image-is-malformed —> System.Data.SQLite.SQLiteException: database disk image is malformed
database disk image is malformed
at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection cnn, System.String strSql, System.Data.SQLite.SQLiteStatement previous, UInt32 timeoutMS, System.String& strRemain) <0x40d9e4b0 + 0x00cc3> in :0
at System.Data.SQLite.SQLiteCommand.BuildNextCommand () <0x40d9e000 + 0x00239> in :0
— End of inner exception stack trace —
at NzbDrone.Core.Datastore.DbFactory.Create (NzbDrone.Core.Datastore.Migration.Framework.MigrationContext migrationContext) [0x00121] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Datastore\DbFactory.cs:116
at NzbDrone.Core.Datastore.DbFactory.Create (MigrationType migrationType) [0x00000] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Datastore\DbFactory.cs:56
at NzbDrone.Core.Datastore.DbFactory.RegisterDatabase (IContainer container) [0x00000] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Core\Datastore\DbFactory.cs:36
at NzbDrone.Host.Bootstrap.Start (ApplicationModes applicationModes, NzbDrone.Common.EnvironmentInfo.StartupContext startupContext) [0x0003d] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Host\Bootstrap.cs:73
at NzbDrone.Host.Bootstrap.Start (NzbDrone.Common.EnvironmentInfo.StartupContext startupContext, IUserAlert userAlert, System.Action`1 startCallback) [0x00075] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Host\Bootstrap.cs:40
at NzbDrone.Console.ConsoleApp.Main (System.String[] args) [0x0000e] in M:\BuildAgent\work\b69c1fe19bfc2c38\src\NzbDrone.Console\ConsoleApp.cs:20

Description of issue: Migrated from Lubuntu to Mint. Saved a copy of the config file and DB file. Stopped Sonarr, imported these into their designated location and attempted to start it again but received the above error. I read on the Sonarr site about the instructions to export this database to new one. I tried using SQLite but its saying either its not a database or its encrypted. Would be very grateful for assistance. Can provide the DB file if necessary. Thanks!

Did you also handle the .db-wal file? See https://github.com/Sonarr/Sonarr/wiki/Backup-and-Restore#restoring-from-backup for more information.

1 Like

I completely forgot to remove that file. That worked for me. Thank you!!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.