Open davidspiess opened 2 years ago
i created a new image and was messing around all day to get my DB to update. since it's staging i decided to destory it and create 15.2 from scratch. i started out with just creating a normal pg server.
to my surprise it created 15.2 itself! it used image flyio/postgres-flex:15.2@sha256:8e00d751bb9811bc8511d7129db2cc5a515449cf4a7def8f1d60faacb2be91c6
so perhaps this can be used to update also.
Seems there is still no official Postgres 15 image...
The Postgres-flex implementation defaults to PG 15: https://github.com/fly-apps/postgres-flex/tree/master
As long as you're running a recent version of flyctl, you should be good.
How do I tell if my Fly Postgres app is running postgres-ha or Postgres-flex? Or more simply, when I run fly image update on my postgres app, it's just updating within the postgres 14 docker images. How do I get it switched to 15?
To see what image you're using, you can use:
fly image show --app <app-name>
If you want to move from Stolon -> Flex, your best bet is to use the fly pg import
feature.
Cool thanks for the pointer! Looks like I'm running on stolon.
fly image show
Image Details
MACHINE ID REGISTRY REPOSITORY TAG VERSION DIGEST
e286e91ce6e686 registry-1.docker.io flyio/postgres 14.6 v0.0.41 sha256:3c25db96357a78e827ca7dbbf4963089bdfcd48fb05a40cd82cfff5c61fb7710
The process to migrate (for me) was approximately the following:
fly pg create
a new Postgres instance. This is created with the new flex image.fly pg import
the old db to the new db.fly secrets unset DATABASE_URL
(detach didn't work for some reason)flyctl postgres attach
the new databasefly deploy
on the app and ensure db credentials and migrations are working etcNote that this approach requires downtime. Shut down your app or put it into maintenance mode that prevents new writes.
Since Postgres 15 was released recently, do you consider adding it in the near future?
fly pg create --image-ref flyio/postgres:15
Thanks :)