Is it possible making backups of your postgres database on a Hobby plan?

molulHOBBY

a year ago

Been following this tutorial to hopefully create a backup of my Strapi project in Railway Hobby plan: https://blog.railway.app/p/postgre-backup

When I run the command and type my password, I get this error after a minute or so:

pg_dump: error: connection to server at (connection info) failed: Operation timed out
Is the server running on that host and accepting TCP/IP connections?

Please note I typed on purpose. And also, I triple-checked the variables I used are correct.

Does this mean the tutorial is not applyable to Hobby plans because they don't accept TCP/IP connections?

If so, would you kindly recommend any way of making backups, hopefully for free?

Thanks a lot in advance.

Solved

5 Replies

a year ago

Hobby plans have no such restrictions, it's possible you are behind some kind of firewall?

But for automatic backups I would recommend this template paired with Cloudflare R2 -

https://railway.app/template/I4zGrH


molulHOBBY

a year ago

Thanks! You were right. I opened the needed port and was able to run pg_dump.

Now, I got these error messages (the three of them are similar and suggest similar solutions):

pgdump: warning: there are circular foreign-key constraints on this table: pgdump: detail: hypertable
pgdump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints. pgdump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.

pgdump: warning: there are circular foreign-key constraints on this table: pgdump: detail: chunk
pgdump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints. pgdump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.

pgdump: warning: there are circular foreign-key constraints on this table: pgdump: detail: continuousagg pgdump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.

And now I've got some doubts:
1 - AFAIK, I did the full dump by not adding the --data-only, so I don't understand that suggestion.
2 - Should I then restore my database by adding -disable-triggers to the pg_restore command?
3 - Was my database actually saved? Or if I ever restore it, it will fail?


a year ago

Those are just warnings and they are of no consequence, you don't need to use any of its suggestions.


Status changed to Solved railway[bot] about 1 year ago


molulHOBBY

a year ago

That's a relief :) I'll try to test a restore on another database during the following weeks.

Thanks a lot for your help ❤️


a year ago

Happy to help!


Is it possible making backups of your postgres database on a Hobby plan? - Railway Help Station