# Discourse restore with pg\_dump

**URL:** https://meta.discourse.org/t/discourse-restore-with-pg-dump/100157
**Category:** Self-hosting
**Created:** [October 22, 2018, 10:01am UTC](https://meta.discourse.org/t/discourse-restore-with-pg-dump/100157 "2018-10-22T10:01:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Lakshmi](https://avatars.discourse-cdn.com/v4/letter/l/ea5d25/32.png) [@Lakshmi](https://meta.discourse.org/u/Lakshmi)
#### Post date: [October 22, 2018, 10:01am UTC](https://meta.discourse.org/t/discourse-restore-with-pg-dump/100157/1 "2018-10-22T10:01:06Z")

</div>

Hi,

I’m using default postgresql that comes with docker, I usually connect to database with

```
sudo ./launcher enter app
su -c 'psql discourse' postgres

```

As the default backups are stored at `/var/discourse/shared/standalone/backups/default/`,once I connect to app, then I will be landing at `/var/www/discourse/`, then i don’t see backup files here.

How can I dump postgreql backup from `/var/www/discourse/`, into discourse database. Example

`psql disocurse < /var/discourse/shared/standalone/backups/default/bakup_dump.sql`

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 22, 2018, 11:56am UTC](https://meta.discourse.org/t/discourse-restore-with-pg-dump/100157/2 "2018-10-22T11:56:30Z")

</div>

The recommended way from inside the container is

```
discourse restore

```

The files are in

```
/shared/backups/default

```

---

<div class="post-metadata">

### Author: ![Lakshmi](https://avatars.discourse-cdn.com/v4/letter/l/ea5d25/32.png) [@Lakshmi](https://meta.discourse.org/u/Lakshmi)
#### Post date: [October 22, 2018, 12:15pm UTC](https://meta.discourse.org/t/discourse-restore-with-pg-dump/100157/3 "2018-10-22T12:15:33Z")

</div>

Thank you. I tried that already, but it does not work, so thought to restore it using pg dump.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 20, 2021, 11:41am UTC](https://meta.discourse.org/t/discourse-restore-with-pg-dump/100157/4 "2021-07-20T11:41:50Z")

</div>


