NixOS and PostgreSQL

Migrating from PostgreSQL 14 to 15

When upgrading to version 15 from 14, there was an issue. None of my data was transferred. To fix this issue I swapped to the postgres user who is a superuser on the PostgreSQL databases.

Then to preform the migration I ran:

-- to do this without swapping user you can use the flag -U
pg_dumpall > sqldump

then when I had the sqldump file, the following command was run from the command line to get use the sqldump file to recover the previous data

Terminal window
psql -f sqldump
© Blog post licensed under CC BY-NC-SA 4.0