# Data Backup

**URL:** https://meta.discourse.org/t/data-backup/288160
**Category:** Self-hosting
**Created:** [December 10, 2023, 4:35pm UTC](https://meta.discourse.org/t/data-backup/288160 "2023-12-10T16:35:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Wleksion](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wleksion/32/306986_2.png) [@Wleksion](https://meta.discourse.org/u/Wleksion)
#### Post date: [December 10, 2023, 4:35pm UTC](https://meta.discourse.org/t/data-backup/288160/1 "2023-12-10T16:35:21Z")

</div>

Discourse is not working, how do I back up my data using terminal?

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [December 10, 2023, 5:28pm UTC](https://meta.discourse.org/t/data-backup/288160/2 "2023-12-10T17:28:04Z")

</div>

> [@Backup discourse from the command line](https://meta.discourse.org/t/backup-discourse-from-the-command-line/64364):
>
> bookmark This guide covers how to back up and restore your Discourse site using command line tools, specifically designed for self-hosted environments. person_raising_hand Required user level: Administrator information_source You can use the below placeholders to automatically fill out the command line prompts in this guide: Backing up To create a backup of your Discourse site, follow these steps: Enter the container: ./launcher enter app Run the backup: discourse backup…

---

<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: [December 10, 2023, 6:20pm UTC](https://meta.discourse.org/t/data-backup/288160/3 "2023-12-10T18:20:39Z")

</div>

It’s not clear what you’re asking.

If you want your discourse data then your best bet is to make it work and make a backup.

You can also use a tool like rsync to copy /var/discourse/shared/standalone somewhere, but then what do you plan to do with that?

Or maybe you want your most recent backup from backups/default.

What is wrong with your discourse and what happened between when it worked and now?

---

<div class="post-metadata">

### Author: ![Wleksion](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wleksion/32/306986_2.png) [@Wleksion](https://meta.discourse.org/u/Wleksion)
#### Post date: [December 10, 2023, 6:26pm UTC](https://meta.discourse.org/t/data-backup/288160/4 "2023-12-10T18:26:05Z")

</div>

I encountered an error in Discourse and I can’t solve it. I plan to reinstall discourse by copying all my data.

---

<div class="post-metadata">

### Author: ![Wleksion](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wleksion/32/306986_2.png) [@Wleksion](https://meta.discourse.org/u/Wleksion)
#### Post date: [December 10, 2023, 6:26pm UTC](https://meta.discourse.org/t/data-backup/288160/5 "2023-12-10T18:26:56Z")

</div>

And strangely, no one in the huge support forum helped me properly solve the problem.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [December 10, 2023, 6:27pm UTC](https://meta.discourse.org/t/data-backup/288160/6 "2023-12-10T18:27:14Z")

</div>

Can you please explain what happened before the error and post the error messages? It may be possible to fix your instance.

edit: Looks like a few people did try to help you, including one of our team members:

> [@I can't start a Discourse](https://meta.discourse.org/t/i-cant-start-a-discourse/287894):
>
> failed with return #\<Process::Status: pid 147 exit 128\> Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec\_command.rb:132:in `spawn' exec failed with the params {"cd"=\>"$home", "hook"=\>"code", "cmd"=\>["sudo -H -E -u discourse git reset --hard", "sudo -H -E -u discourse git clean -f", "sudo -H -E -u discourse bash -c '\n set -o errexit\n if [$(git rev-parse --is-shallow-repository) == \"true\"]; then\n git remote set-branches --add origin main\n git r…

Closing this topic so discussion can continue there.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [December 10, 2023, 6:30pm UTC](https://meta.discourse.org/t/data-backup/288160/7 "2023-12-10T18:30:03Z")

</div>


