Thought I would let you all know in case you have missed it. A few days ago Postgres support was finally merged into Sonarr dev branch (meaning 4.x version). I have already transitioned to it, so far it runs without issue

You can mostly follow the same instructions as for Radarr from here: https://wiki.servarr.com/radarr/postgres-setup

I used the following temporary docker container to do the conversion (obviously replace stuff you need to):

docker run --rm -v Route\to\sonarr.db:/sonarr.db --network=host dimitri/pgloader pgloader --debug --verbose --with “quote identifiers” --with “data only” “sqlite://sonarr.db” “postgresql://user:pwd@DB-IP/sonarr-main”

When it completed the run, it outputs a kind of table that shows if there were any errors. In my case there were 2 tables (cant remember which ones anymore) that couldn’t be inserted, so I edited those manually afterwards, so it matches the ones in the original DB.

  • admin@lm.boing.icuOP
    link
    fedilink
    English
    arrow-up
    9
    ·
    11 months ago

    Basically this. I have my home stuff running in a K3S cluster, and I had to restore my Sonarr volume several times because the SQLite DB has corrupted. Transitioning to Postgres should solve this issue, and I already have quite a few other stuff in it, for example Radarr and Prowlarr

      • admin@lm.boing.icuOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 months ago

        Yeah I’m using Longhorn. Might be that I have set it up wrong, but didn’t seem to have helped with the DB corruption issue.

        • HTTP_404_NotFound@lemmyonline.com
          link
          fedilink
          English
          arrow-up
          1
          ·
          11 months ago

          If you are using longhorn in RWO mode, you shouldn’t have any issues as it passes block storage directly to the pod, via iscsi. No file/nfs storage involved.

          • admin@lm.boing.icuOP
            link
            fedilink
            English
            arrow-up
            1
            ·
            11 months ago

            Here is what I’m using atm. Is there a better way to do this? I’m still learning K8S :)

            apiVersion: v1
            kind: PersistentVolumeClaim
            metadata:
              name: sonarr-pvc
            spec:
              accessModes:
                - ReadWriteOnce
              storageClassName: longhorn
              resources:
                requests:
                  storage: 250Mi
            ---
            [....]
            volumes:
                  - name: config
                    persistentVolumeClaim:
                      claimName: sonarr-pvc