Taking back-up of postgres database

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 mismatch
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 mismatch
I 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?
Railway Blog
How to Backup and Restore Your Postgres Database
In this post, we will go over the process of backing up and restoring your Postgres database hosted on Railway.
Solution:
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...
Jump to solution
6 Replies
Percy
Percy8mo ago
Project ID: 76c6f0bb-2ca0-4c7c-803f-e1ae1fba90ca
highandover
highandover8mo ago
76c6f0bb-2ca0-4c7c-803f-e1ae1fba90ca
Solution
Brody
Brody8mo 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
highandover
highandover8mo ago
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.
highandover
highandover8mo ago
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
pg_restore
command to upload my database dump without issues. However, when I then ran the
pg_restore
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
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.
Railway Blog
How to Backup and Restore Your Postgres Database
In this post, we will go over the process of backing up and restoring your Postgres database hosted on Railway.
highandover
highandover8mo ago
Sorry — I realised there's such a thing as google. Found the answer. Moving back to Solved.
Want results from more Discord servers?
Add your server