If you're running Postgres in Docker, you can just stop the container and tar up the data volume and start it somewhere else
(This also works without Docker of course, but Docker makes me feel safer when I do stuff like this)
(This also works without Docker of course, but Docker makes me feel safer when I do stuff like this)
Since we're talking about copying a folder, I'm not sure why you'd feel safer doing it via an additional layer of abstraction.
I know that PG data is usually in /var/lib/postgresql/data, but I like Docker because if I ever need a 2nd or 3rd database on one system, I can give them more meaningful names and not feel like I'm touching Important System-Wide Stuff.
My intuition is that you're expected to do some kind of migration or export/import, because the on-disk format probably changes between major versions.