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:
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:Jump to 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...
6 Replies
Project ID:
76c6f0bb-2ca0-4c7c-803f-e1ae1fba90ca
76c6f0bb-2ca0-4c7c-803f-e1ae1fba90ca
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
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 command to upload my database dump without issues.
However, when I then ran the 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 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.
Sorry — I realised there's such a thing as google. Found the answer.
Moving back to Solved.