Earlier quoted context omitted.
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)
Does this work even when the Postgres is updated to a newer version? This would make me want to use docker as well.
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.