pg_restore into a new database
Let's define a couple of variables to make the rest easier to copy/paste (using names from the original question)

old_db=myapp
new_db=myapp3
db_dump_file="backups/myapp_2018-05-27.pg.dump"


The following assumes that your backup was created with the "custom" format like this:

pg_dump -U postgres -F custom "$old_db" &gt; "$db_dump_file"


To restore $db_dump_file to a new database name $new_db :

dropdb   -U postgres --if-exists  "$new_db"
createdb -U postgres -T template0 "$new_db"

pg_restore -U postgres -d "$new_db" "$db_dump_file"