Sometimes heroku pg:copy
fails, in that case, we can use pg_restore
command
Get the credentials
heroku pg:credentials DATABASE_URL -a <app-name>
Restore
pg_restore --verbose --clean --no-acl --no-owner -h <host name> -U <username> -d <db name> -p 5432 latest.dump --password