Forums

Create postgres backup file with all data (Users, Tables etc)

Hi dear all! 1) Can't find console command to create a backup postgres file with all data (including all users, all groups, all tables and so on. Full cluster I guess it called. And yeah, I mean - "cumbersome and inappropriate mechanism". I need it ;)) 2) And if I create it, how I can restore it back? I configured a regular backups and it already saved something, but I'm not so sure - does it contain all data or ...whether it contains anything at all?? Help me please with all this console command (create and restore). P.S.: It will be grateful if all this complete tips will be at help.pythonanywhere page in "Postgres setup and configuration" chapter (for Dummies like me, lol) Thank you very much in advance for any help!!!

See https://help.pythonanywhere.com/pages/RegularPostgresBackups/

If you use pg_dumpall, it will include global objects.

Thanks! Got pg_dumpall: unrecognized option '--format=c' Try "pg_dumpall --help" for more information. Could you provide complete/correct syntax please? p.s.: Why this pg_dump --host=NikolayKotik-2377.postgres.pythonanywhere-services.com --port=12377 --username=super --format=c --file=myChecklistAppDBdate +%F-%H%M.dump checklistdb works for daily task and I can see file created in file directories, but doesn’t work when I hit it in postgres console? Thanks a lot!

The documentation page that I linked to describes the arguments that pg_dumpall takes. It looks like it does not accept the --format argument.

It does not work in a Postgres console, because that is a database console and pg_dumpall is a program that you need to run. You can do that from a Bash console.

Yeah, it works via Bash console! Thanks for help).

Glad to hear that you made it work!