Migrating from Windows to docker on unRAID - keeping the history database

Sonarr version (exact version): 2.0.0.4855
OS: Windows 8.1

I am about to migrate my server (currently win 8.1) to unRAID. I will be running Sonarr (and nzbget and transmission or qbittorrent) in docker on unRAID.
Obviously the paths will be completely different on the new server. And I’ve read this:
Restoring to an OS that uses different paths won't work
in the: Backup and Restore · Sonarr/Sonarr Wiki

Questions:

  1. I have no problem setting up Sonarr from scratch - I mean all the settings, folders, importing all the shows, etc. The most important thing I would like to keep and not loose during migration is the database with all the history. Is that possible somehow?
  2. If keeping the history in database is possible, then what is the best way to migrate Sonarr from windows to docker on unRAID?

At least for me personally, the 2nd most important and usefull thing that Sonarr brings (auto downloading of the episodes being the 1st), is the file history. I love being able see how any particular episode got into my collection, from where and when. Especially, the quality/propers history. Well, I’m sure everybody here knows what I mean.

I would very much like not to loose this history because of migration. I know the file paths in history will be crap - buts that’s obviously not a problem.

It’s possible, but you’ll have to edit the sqlite database manually to replace the paths in the Series, RootFolders and Episodes tables.
There are plenty of sqlite tools available, including a firefox browsers extension.

Thanks for an answer, and I’m very happy, I will not be loosing the history!

Could you please confirm, If I understand the migrating the steps correctly:

  1. I make a manual backup in Sonarr:
    System > Backup > Backup

  2. Shutdown Sonarr on windows
    (I need to stop running it, while moving the files from windows to unRAID)

  3. Install Sonarr docker container on unRAID

  4. Extract the nzbdrone.db from the backup zip file

  5. Edit all the path values (from old windows paths to new/correct unRAID paths) in the nzbdrone.db database manually

    • edit Path column in RootFolders table
    • edit Path column in Series table
    • edit RelativePath column in EpisodeFiles table
    • edit RelativePath column in ExtraFiles table
    • edit RelativePath column in SubtitleFiles table
  6. Question: the config.xml file in the backup zip contains a key:
    <UpdateMechanism>BuiltIn</UpdateMechanism>
    which I assume is not OK in this situation? I mean, the update process is not in-built, when using Sonarr in a docker container, but rather you update the container itself, when the new version comes out, right? Hence, how about this config.xml - should I remove it from zip file altogether, or edit it in some way?

  7. Question: how do I restore from backup? Simply overwrite the nzbdrone.db (and config.xml, depending on the answer in #6)?

  8. Launch Sonarr container on unRAID, go into settings and:

  • change the path for: Recycle Bin in Setting > Media Management (or I could have changed it in the database, probably…)
  • change the settings for the Download Clients (not sure, if there’s gonna be anything to change, actually…)

And, I assume, that it? Sonarr should work, as if “nothing happened”?

  1. yes
  2. yes
  3. yes
  4. I’d just shut down Sonarr and copy the entire folder including db, logs, mediacovers etc, to unraid, chmod/chown properly.
  5. Then edit the db.
  6. depends on how you intend to keep Sonarr updated, we don’t provide an official docker container nor update logic for it. so it’s all third party. This is what i dislike about docker. It used to be simple.
  7. Careful there, a sqlite db consists of multiple files. .db-wal is part of it.
  8. either.

assuming all that, it should work, but you’d be lucky if it goes without a hitch.

1 Like

So basically:

  1. same
  2. same
  3. same
  4. copy\overwrite all the folders and files, except bin folder (I assume) from C:\ProgramData\NzbDrone
  5. change the permissions for these files and folders
  6. edit the nzbdrone.db
  7. Launch Sonarr and edit the settings for Recycle Bin and Download Clients

I’m thinking, if anything goes wrong - it’s docker, so I can easily delete, re-create the container and try again…
At the end of the day, I’m very much willing to spend time on this, just to keep the history…

Yup, that’s it. Just keep a backup and you’re safe.

PS: the data should be in a mounted volume in the docker container, so that replacing the container doesn’t delete the data. but I assume you know that.

1 Like

Yep, and thanks a lot for the answers.

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