# Better auto-backup options

**URL:** https://meta.discourse.org/t/better-auto-backup-options/33351
**Category:** Feature
**Tags:** backups, s3
**Created:** [September 16, 2015, 1:20pm UTC](https://meta.discourse.org/t/better-auto-backup-options/33351 "2015-09-16T13:20:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ky\_metro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ky_metro/32/42807_2.png) [@ky\_metro](https://meta.discourse.org/u/ky_metro)
#### Post date: [September 16, 2015, 1:20pm UTC](https://meta.discourse.org/t/better-auto-backup-options/33351/1 "2015-09-16T13:20:43Z")

</div>

We could use a few more options for automatic backups. Digital Ocean offers pretty limited disk space, whereas S3 is infinite. Currently they are synced together, meaning S3 is limited to available local space. On my site, that means two daily backups complete, then the process stalls.

Here’s some ideas:

- Option to backup database only (no files). This option is available already for manual backups. It saves a lot of space for file-heavy sites, and allows more backups to be stored locally.

- Better scheduler. With two backup options, you will want the ability to do both at different times (ie daily database backups plus weekly full backup).

- Option to manage S3 storage separate from Discourse. Again, with limited local disk space, I’d like the option to keep one daily backup on local disk but infinite backups on S3.

- If there’s not enough local disk space left, delete the oldest backup before starting a new one. This would prevent a full disk from stalling your backups, assuming they are similar in size.

- Notification if auto-backup failed to run. Right now it fails silently, and I have to remember to check on it.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [November 12, 2015, 3:24pm UTC](https://meta.discourse.org/t/better-auto-backup-options/33351/2 "2015-11-12T15:24:52Z")

</div>

> [@ky\_metro](#):
>
> Option to backup database only (no files). This option is available already for manual backups. It saves a lot of space for file-heavy sites, and allows more backups to be stored locally.

It’s now available through the “`backup_with_uploads`” site setting 😉

[https://github.com/discourse/discourse/commit/de95573d2389099b754869f511bd18515c47e53e](https://github.com/discourse/discourse/commit/de95573d2389099b754869f511bd18515c47e53e)

---

<div class="post-metadata">

### Author: ![ky\_metro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ky_metro/32/42807_2.png) [@ky\_metro](https://meta.discourse.org/u/ky_metro)
#### Post date: [August 3, 2017, 8:57pm UTC](https://meta.discourse.org/t/better-auto-backup-options/33351/4 "2017-08-03T20:57:36Z")

</div>

Well, revisiting this. Glad to report this has worked great for awhile, by manipulating S3 settings and using Glacier:

> [@ky\_metro](#):
>
> Option to manage S3 storage separate from Discourse. Again, with limited local disk space, I’d like the option to keep one daily backup on local disk but infinite backups on S3.

This one is fixed too, apparently:

> [@ky\_metro](#):
>
> - Notification if auto-backup failed to run. Right now it fails silently, and I have to remember to check on it.

It will now notify you if backups fail. Yay! Unfortunately the way I found that out is when my disk filled up again…

* * *

So, I have a question about the files backup procedure. Currently I need at least double the backup’s size in available free space. For example my currently 8GB install needs 16 GB of free space for a backup to succeed. Otherwise gzip runs out of space, and the backup fails.

I assume that the backup script copies all the files to be backed up to a temp folder, then begins to zip the copies? Could it not work directly from the original files, and avoid this double space requirement?

* * *

Related, and this maybe should be a bug report. When the backup does fail, the script does not delete the partial failed backup file, which can be quite large. Because of this, multiple failed attempts will entirely fill up the disk and possibly crash the site.

---

<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: [August 3, 2017, 9:36pm UTC](https://meta.discourse.org/t/better-auto-backup-options/33351/5 "2017-08-03T21:36:59Z")

</div>

> [@ky\_metro](#):
>
> I assume that the backup script copies all the files to be backed up to a temp folder, then begins to zip the copies? Could it not work directly from the original files, and avoid this double space requirement?

We looked at this in exhaustive depth about 6 months ago. This is _only_ true if you back up just the database. Once you have to backup the database _and the uploads too_, it is unavoidable that you need to merge the database backup, which is one giant streamed-to-compression file, with a bunch of `.jpg` and `.gif` and `.png` and `.doc` uploaded files, so at that point you need 2x disk space and that 2x space cost is indeed unavoidable.

So, if disk space is at a premium, select the “database only” backup style, and back up the uploads some other way. Compressing gifs and jpgs doesn’t work very well anyway, so just straight copying them out is a viable strategy, minus “lots of tiny files” processing overhead.

cc @pfaffman

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [December 4, 2025, 11:36am UTC](https://meta.discourse.org/t/better-auto-backup-options/33351/6 "2025-12-04T11:36:59Z")

</div>


