I'm working on PostgreSQL 8.4 and I'd like to do backup and restore (from Ubuntu 11.10 to Ubuntu 12.4)
I want to include all partitions, clusters, roles and stuff.
My commands: Back up:
dumb_all > filename
Compress:
zip -f mybackup
Uncompress and restore:
sudo gunzip -c /home/ubuntu/Desktop/backupFile.zip | psql -U postgres
The issue is in the restore process, I got an error
invalid command \.
ERROR: syntax error at or near "2"
LINE 1: 2 2 1
^
invalid command \.
ERROR: syntax error at or near "1"
LINE 1: ...
^
out of memory
Plus, the tables with partitions did not restored. also some tables restored without any data!
Please help!
EDIT
I used pgAdmin to do the back up, using the "backup server" option.

dump_allthen compressed the result usingzip -f mybackupthen uncompressed and restored it in another DB using one commandsudo gunzip -c /home/ubuntu/Desktop/backupFile.zip | psql -U postgresDo you have a better method?zip -f mybackupwould generate a file namedbackupFile.zip? Anyway, I think I guessed your problem, see my answer...