TL;DR: Once you prepare the connection, pg_dump is your friend.
Recently, we had to migrate a large-ish DB (1.5 TB) from a Windows installation to a Linux one in order to accommodate a series of third party extensions. We have split the process in three:
1. Prepare