# How to backup Discourse + Database from Console?

**URL:** <https://meta.discourse.org/t/how-to-backup-discourse-database-from-console/54169>\
**Category:** Product Support\
**Created:** [December 13, 2016, 9:24am UTC](https://meta.discourse.org/t/how-to-backup-discourse-database-from-console/54169 "2016-12-13T09:24:04Z")\
**Posts on this page:** 6\
**Page:** 1

## AI-generated summary

Before upgrading Discourse, it's recommended to create a full backup. [Lutz](/t/-/54169/1) considered stopping Discourse, then tarring `/var/discourse` and `/var/lib/docker`, but [codinghorror](/t/-/54169/2) notes that downgrading to older Discourse versions is generally not possible. A better approach, suggested by [pfaffman](/t/-/54169/4), is to set up a separate staging site sharing an S3 backup bucket with the main site. This allows for easy restoration of live data to the staging site and testing of upgrades before applying them to the main site.

<div class="post-metadata">

**Author:** ![Lutz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lutz/32/65103_2.png) [@Lutz](https://meta.discourse.org/u/Lutz)\
**Post date:** [December 13, 2016, 9:24am UTC](https://meta.discourse.org/t/how-to-backup-discourse-database-from-console/54169/1 "2016-12-13T09:24:04Z")

</div>

Let’s say I want to try a new version of Discourse. For safety reasons I would like to backup everything, so I can do a easy roll-back to the last version. I generally do a “git pull && ./launcher rebuild app” to get the new versions.I only run discourse at my docker installation.

Is it enough enough to stop discourse, tar everything from /var/discourse and /var/lib/docker? Is there a better solution, maybe with docker commands?

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [December 13, 2016, 8:41pm UTC](https://meta.discourse.org/t/how-to-backup-discourse-database-from-console/54169/2 "2016-12-13T20:41:50Z")

</div>

It is generally not possible to downgrade to older Discourse versions.

However taking a full backup before the upgrade should work.

---

<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:** [April 8, 2019, 5:52pm UTC](https://meta.discourse.org/t/how-to-backup-discourse-database-from-console/54169/3 "2019-04-08T17:52:46Z")

</div>

Automatically bumped on April 8, 2019, 5:52pm UTC



---

<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:** [April 8, 2019, 6:06pm UTC](https://meta.discourse.org/t/how-to-backup-discourse-database-from-console/54169/4 "2019-04-08T18:06:27Z")

</div>

The solution that I recommend now is to have a separate staging site that shares an S3 backup bucket with the main site. You also want to see that the staging site won’t send email; an easy solution is to configure it with bogus SMTP settings.

With this in place, you can easily restore the most recent live data to the staging site and run an upgrade there. If it works, you run the upgrade on the main site. If you’re paranoid, you see what commit the staging site is running and enter that as the `version` in your `yml` file.

---

<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:** [June 28, 2022, 3:58am UTC](https://meta.discourse.org/t/how-to-backup-discourse-database-from-console/54169/6 "2022-06-28T03:58:43Z")

</div>

Automatically bumped on June 28, 2022, 3:58am UTC



---

<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:** [June 28, 2022, 9:31pm UTC](https://meta.discourse.org/t/how-to-backup-discourse-database-from-console/54169/7 "2022-06-28T21:31:44Z")

</div>

Closed on June 28, 2022, 9:31pm UTC


