# Discourse CLI - backup WITH uploads

**URL:** https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647
**Category:** Support
**Tags:** unsupported-install
**Created:** [May 17, 2021, 9:59am UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647 "2021-05-17T09:59:19Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Marcin\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcin_j/32/215377_2.png) [@Marcin\_J](https://meta.discourse.org/u/Marcin_J)
#### Post date: [May 17, 2021, 9:59am UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/1 "2021-05-17T09:59:20Z")

</div>

When invoking `discourse backup`, it creates an sql.gz file, which does not contain uploads. When creating a backup from the UI, there is an option to take it with the uploads. Is there a way to do a backup with uploads using the CLI?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [May 17, 2021, 10:13am UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/2 "2021-05-17T10:13:39Z")

</div>

There is no option for enabling it in the CLI right now, but it should include uploads when the `backup_with_uploads` site setting is enabled.

---

<div class="post-metadata">

### Author: ![Marcin\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcin_j/32/215377_2.png) [@Marcin\_J](https://meta.discourse.org/u/Marcin_J)
#### Post date: [May 17, 2021, 10:25am UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/3 "2021-05-17T10:25:22Z")

</div>

I have this setting enabled:  
 ![image](https://global.discourse-cdn.com/meta/original/3X/4/e/4e449a23dcd3de47ba6a3944e04332b8d756f328.png)

However, anytime I do `discourse backup` I get `sql.gz`.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [May 17, 2021, 10:26am UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/4 "2021-05-17T10:26:22Z")

</div>

Are your uploads stored on S3?

---

<div class="post-metadata">

### Author: ![Marcin\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcin_j/32/215377_2.png) [@Marcin\_J](https://meta.discourse.org/u/Marcin_J)
#### Post date: [May 17, 2021, 10:27am UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/5 "2021-05-17T10:27:19Z")

</div>

No, I store them locally.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [May 17, 2021, 10:34am UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/6 "2021-05-17T10:34:33Z")

</div>

Weird. Did you follow [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) when you set up your site?

---

<div class="post-metadata">

### Author: ![Marcin\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcin_j/32/215377_2.png) [@Marcin\_J](https://meta.discourse.org/u/Marcin_J)
#### Post date: [May 17, 2021, 10:52am UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/7 "2021-05-17T10:52:24Z")

</div>

No, my setup is rather custom, since I’m running Discourse on Kubernetes. However, my Discourse images (web and data) have been generated using the `launcher` script without any modifications.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [May 17, 2021, 11:01am UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/8 "2021-05-17T11:01:02Z")

</div>

Hmm, you are probably missing some env variable, or the working directory is wrong, or something like that. I’ve seen reports about similar issues from Bitnami installs. Unfortunately we can’t help you with that, you’ll need to figure this out yourself.

---

<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: [May 17, 2021, 12:15pm UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/9 "2021-05-17T12:15:07Z")

</div>

One way to do it might be to set up a standard installation, rsync the images (there a guides for moving to a new server), and then restore the backup. Then you could take a backup there.

If you have a budget, I might be able to help with your current setup [Redirecting…](https://www.literatecomputing.com/discourse-support/)

---

<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: [May 17, 2021, 11:25pm UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/10 "2021-05-17T23:25:51Z")

</div>

My guess is that you don’t have backups mapped to persistent space, so I think what you need to do is **inside a pod** , run `discourse backup` and then copy the backup file from `/shared/backups/default` inside **that** pod to outside of the pod. I’m pretty sure that’s what I do in the k8s setup that I have in GCP k8s (where you can’t use the buckets for backup because Google).

---

<div class="post-metadata">

### Author: ![Marcin\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcin_j/32/215377_2.png) [@Marcin\_J](https://meta.discourse.org/u/Marcin_J)
#### Post date: [May 20, 2021, 6:42pm UTC](https://meta.discourse.org/t/discourse-cli-backup-with-uploads/190647/12 "2021-05-20T18:42:46Z")

</div>

I do have backups on a persistent volume. I’m on AKS, and backups are on Azure Files.

I reset my deployment (forcing new pods to come up), and the backups are now “full” (tar.gz). I’ve no idea what has changed honestly.
