PostgreSQL Copy Database Made Easy
Summary: in this tutorial, you will learn how to copy a PostgreSQL database on the same server or from a server to another. Sometimes, you want to copy a PostgreSQL database within a database server for testing purposes. PostgreSQL makes it easy to do it via the CREATE DATABASE statement as follows: This statement copies the sourcedb to the targetdb.
https://www.postgresqltutorial.com/postgresql-copy-database/