2 years ago
Hey — I'm trying to back-up a postgres db from my Railway project to my Mac. I found this guide: https://blog.railway.app/p/postgre-backup
Problem is I get this error:
pg_dump: error: server version: 16.0 (Debian 16.0-1.pgdg120+1); pg_dump version: 14.11 (Homebrew)
pg_dump: error: aborting because of server version mismatchI can't seem to update postgresql beyond version 14.11 on my Mac.
Anyone found a solution to this without having to use something like the S3 or Gdrive back-ups?
5 Replies
2 years ago
exactly as the error suggests, your version of pg_dump is not compatible with the version of postgres running on railway.
please update your pg_dump to the version compatible with the version of postgres in use, aka postgres 16 requires pg_dump 16
Thanks @Brody — I've not been able to upgrade to v16 on my Mac using Homebrew but trying to install v16 direct from the installer package now.
Sorry — not quite "Solved" yet.
I followed the guide: https://blog.railway.app/p/postgre-backup
I managed to export my Database to my local machine no worries.
Then I started a new project on Railway with a new instance of Postgres and was able to use the pg_restore command to upload my database dump without issues.
However, when I then ran the pg_restore command to restore my database to the same instance I took the dump from it didn't run. A stream of errors were output in the terminal and seeminly no changes were made to my original database.
Have I mis-understood how the pg_restore command actually works? I thought it would overwrite my database with the contents of the dump file.
is that not the case?
Sorry if this is a n00b question — all a bit new to me.
Sorry — I realised there's such a thing as google. Found the answer.
Moving back to Solved.