Hi, @Jellybean Welcome to the Microsoft Q&A forum, and thanks for reaching out.
As we understand you are migrating the Postgres server to a different Postgres server and want to know what is the best way to do it.
Always dump and restore are better options as it less complicated but again if downtime and other factors come into play then DMS might provide better alternatives.
Offline method using PostgreSQL pg_dump and pg_restore which incurs downtime for migrating the data. This document addresses this method of upgrade/migration.
Online method using Database Migration Service (DMS). This method provides a reduced downtime migration and keeps the target database in-sync with the source and you can choose when to cut-over. However, there are a few prerequisites and restrictions to be addressed for using DMS. For details, see the DMS documentation
Regards
Geetha