11
0.19.4 Prerequisites (tkohhh.social)
submitted 6 months ago by tko@tkohhh.social to c/lemmy_support@lemmy.ml

The release notes for 0.19.4 mention that this version requires an upgrade to both pictrs and postgres, but there isn't any information about what versions of those are supported. Is there someplace else I should be looking for this information? Or should I just YOLO with the latest version of each?

top 9 comments
sorted by: hot top controversial new old
[-] NeonWoofGenesis@l.henlo.fi 5 points 6 months ago

Well the join-lemmy.org docker-compose file reads docker.io/postgres:16-alpine, and with your mention, I switched from version 15 to 16 but the postgres container errored with not being compatible with a version 15 initialized data directory.

My instance has been running fine on v15 so far. (I switched back to 15 in the compose file and it works again)

Would be nice with lemmy documentation how to migrate from 15 to 16.

You need to export your DB and impirt it again. You can not simply upgrade. Switch back to v15 and make a dump.

Here is a little guide.

Pict-rs can be upgraded simply. Edit your docker-compose.yml and spin it up. After tge upgrade is complete, you can do the postgres upgrade

[-] tko@tkohhh.social 2 points 5 months ago* (last edited 5 months ago)

I successfully migrated postgres 15 to 16. I followed the general idea of the guide you posted, but I found it a little easier to do a slightly different process. Here's what I did:

  1. docker-compose down for the lemmy instance

~~2. edit the docker-compose.yml file and comment out all of the services except postgres. In addition, add a new volume to the postgres service that looks something like this: - ./volumes/miscfiles:/miscfiles~~

  1. edit the docker-compose.yml file and add a new volume to the postgres service that looks something like this: - ./volumes/miscfiles:/miscfiles
  2. docker-compose up -d postgres (this starts just the postgres service from the docker compose file)
  3. docker exec -it [container name] pg_dumpall -U [username] -f /miscfiles/pgdumpall20240628 (I think this will work, but it's not exactly what I did... rather, I ran docker exec -it [container name] bash, and then ran pgdumpall -U [username] -f /miscfiles/pgdumpall20240628. The end result is a dumpall file saved in the ./volumes/miscfiles directory on the host machine)
  4. docker-compose down
  5. mv ./volumes/postgres ./volumes/postgresBAK20240628 (move your existing postgres data to a new directory for backup purposes)
  6. mkdir ./volumes/postgres (re-create an empty postgres data folder. make sure the owner and permissions match the postgresBAK20240628 directory)
  7. edit the docker-compose.yml and update the postgres image tag to the new version
  8. docker-compose up -d postgres (you'll now have a brand new postgres container running with the new version)
  9. docker-exec -it [container name] psql -U [username] -f /miscfiles/pgdumpall20240628 (again, I think this will work, but I bashed in and ran the command from within the container. This also allows you to watch the file execute all of the commands... I don't know if it will do that if you run it from the host.)
  10. docker-compose down

~~12. edit the docker-compose.yml and un-comment all of the other services that you commented out in step 2~~

  1. docker-compose up -d

Hopefully that helps anyone that might need it!

edited to reflect the comment below

[-] morethanevil@lemmy.fedifriends.social 2 points 5 months ago* (last edited 5 months ago)

If you only want to start 1 service of your entire compose file just use the name in the service section. No need to comment out everything else. For Lemmy it would be: docker compose up -d postgres

This will only start the postgres container of this stack. Glad you found a way which worked for you ☺️

[-] tko@tkohhh.social 2 points 5 months ago

ahhhh yes, that makes perfect sense... thank you for pointing that out! Especially since I'm not good enough with vi to know how to bulk delete the first character in specific lines, I had to manually arrow and delete.

[-] Max_P@lemmy.max-p.me 2 points 6 months ago

AFAIK the only downside of still being on 15 is it doesn't perform quite as well on high traffic instances but should otherwise be fine.

[-] ShellMonkey@lemmy.socdojo.com 1 points 6 months ago

I looked about for it and the PG update basically involves creating a new folder to initialize and then exporting/importing the old DB, but haven't successfully done so yet here.

[-] Max_P@lemmy.max-p.me 3 points 6 months ago

Postgres 16 and pict-rs 0.5.16, but neither are critical it'll just miss features. Like if you use pict-rs 0.4.x then you can't use the image proxy, but you shouldn't anyway.

[-] tko@tkohhh.social 1 points 6 months ago

Thank you, that's super helpful!

this post was submitted on 26 Jun 2024
11 points (100.0% liked)

Lemmy Support

4677 readers
1 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS