Discourse CLI - backup WITH uploads

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?

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.

1 Like

I have this setting enabled:
image

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

Are your uploads stored on S3?

No, I store them locally.

Weird. Did you follow discourse/INSTALL-cloud.md at master · discourse/discourse · GitHub when you set up your site?

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.

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.

1 Like

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 Discourse Support — Literate Computing, LLC

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).

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.

1 Like