# Transferring Postgres from Heroku

**URL:** <https://community.fly.io/t/transferring-postgres-from-heroku/6611>\
**Category:** Questions / Help\
**Created:** [August 27, 2022, 7:50am UTC](https://community.fly.io/t/transferring-postgres-from-heroku/6611 "2022-08-27T07:50:41Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![tj1](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tj1](https://community.fly.io/u/tj1)\
**Post date:** [August 30, 2022, 2:59pm UTC](https://community.fly.io/t/transferring-postgres-from-heroku/6611/13 "2022-08-30T14:59:47Z")

</div>

You’ve connected correctly, but you need to use the correct database name.

```auto
psql -U postgres -h localhost -p 15432 -d your_database < latest.dump

```

You can find out the name of your databases by connecting locally and listing them with `\l`

```auto
postgres=# \l
                                    List of databases
   Name | Owner | Encoding | Collate | Ctype | Access privileges   
  
-----------+------------+----------+------------+------------+-------------------------
--
 main | flypgadmin | UTF8 | en_US.utf8 | en_US.utf8 | 
 postgres | flypgadmin | UTF8 | en_US.utf8 | en_US.utf8 | 
 template0 | flypgadmin | UTF8 | en_US.utf8 | en_US.utf8 | =c/flypgadmin           
 +
           | | | | | flypgadmin=CTc/flypgadmi
n
 template1 | flypgadmin | UTF8 | en_US.utf8 | en_US.utf8 | =c/flypgadmin           
 +
           | | | | | flypgadmin=CTc/flypgadmi
n
(4 rows)

```

---

_[View the full topic](https://community.fly.io/t/transferring-postgres-from-heroku/6611)._
