How to migrate Postgres database
You have two options:
Dumpfile is totally headless and can be done by the CLI unattended using
pg_restore. However, it is a binary file so you cannot make any adjustments to the contents between dump and restore.
SQL outputs a massive
INSERT script that allows you to see what is going on, and make any syntax changes that might be needed if your Postgres versions are different. Since it does not use
pg_restore, you need to manually respond to a password prompt via
psql if you go this way.