Backstory: I had a debian 11 VPS. I installed the postgresql program from the debian 11 apt repo, back a few months ago. Back then, it was postgres 13 on the debian stable repos.

Fast forward couple months: debian 12 comes out. I do a “apt dist-upgrade” and in-place upgrade my VPS from debian 11 to debian 12. Along with this upgrade, comes postgresql 15 installed.

Now, fast forward couple more months: lemmy 0.18.3 comes out. I do not upgrade (I am on lemmy 0.18.2—afaik).

Fast forward some time, too: lemmy 0.18.4 comes out. I decide to upgrade to 0.18.4 from my existing 0.18.2.

I pull the git repo. Compile it locally. It goes well, no errors in the compilation process. I stop the lemmy systemd service, then I “mv” the compiled “lemmy_server” to /usr/bin dir.

I try to restart the now-upgraded lemmy systemd service. However, the systemd service fails.

I check the sudo journalctl -fu lemmy and I see the following error message:

lemmy_server[17631]: thread 'main' panicked at 'Couldn't run DB Migrations: Failed to run 2023-07-08-101154_fix_soft_delete_aggregates with: syntax error at or near "trigger"', crates/db_schema/src/utils.rs:221:25 

I report this issue here: https://github.com/LemmyNet/lemmy/issues/3756#issuecomment-1686439103

However, after a few back and forths and internet search, I conclude that somewhere between lemmy 0.18.3 and 0.18.4, lemmy stops supporting psql <15. So, my existing DB is not compatible.

Upon my investigation on my VPS setup, I concluded that psql 15 is running, however, lemmy is using the psql 13 tables (I do not know if this is the correct term).

Now my question: is there a way to import the lemmy data I had in the psql 13 tables to a new psql 15 table (or database, I don’t know the term).

To make things hairier: I also run a dendrite server on the same VPS, and the dendrite server is using the psql 15 with psql 13 tables on the same database as the lemmy one.

The dendrite database is controlled by a psql user named “dendrite” and the lemmy database is controlled by a psql user named “lemmy” . I hope this makes differentiation between two databases possible. And so I do not harm my existing dendrite database.

Any recommendations about my options here?

    • @k4r4b3y@monero.townOP
      link
      fedilink
      21 year ago

      To verify, here is what I have added to my lemmy.service file:

      Environment=LEMMY_DATABASE_URL=postgres://lemmy:REDACTED@127.0.0.1:5433/lemmy
      
        • @k4r4b3y@monero.townOP
          link
          fedilink
          2
          edit-2
          1 year ago

          So, I save the edit and quit the lemmy service file. And then do sudo systemctl enable --now lemmy.service ?

          EDIT: OK. Systemctl reports that lemmy.service is active and runnning.

          • RoundSparrowM
            link
            fedilink
            2
            edit-2
            1 year ago

            I assume it is already enabled from when you ran 0.18.2…

            on Ubuntu 22.04 if I try to start it after editing the service config it tells me to run a command to rebuild some cache. But I don’t know if Debian is using different service control architecture… hard to keep up with the debates ;)

            I don’t see any harm to just issue a start

            • @k4r4b3y@monero.townOP
              link
              fedilink
              21 year ago

              I did start my lemmy.service, and then I started my lemmy-ui.service (I had it disabled, too, since the lemmy.service wasn’t working for the last week).

              Now I navigate to the frontpage of my lemmy instance (hostname.tld) and lemmy-ui is asking me to setup the instance.

              Is something wrong? I was expecting my old posts with the old sub-lemmy’s show up?

              • RoundSparrowM
                link
                fedilink
                21 year ago

                lemmy-ui is asking me to setup the instance.

                yha, that’s no good… it thinks it is talking to an empty database.

                Is something wrong?

                yes.

                • @k4r4b3y@monero.townOP
                  link
                  fedilink
                  21 year ago

                  When I click “Linked Instances” in the lemmy-ui, it starts populating the old lemmy instances that my instance was connected to. Maybe if I wait sometime, my posts would return?