# Suggested improvements to discourse backup format

**URL:** https://meta.discourse.org/t/suggested-improvements-to-discourse-backup-format/77451
**Category:** Feature
**Created:** [January 8, 2018, 5:41am UTC](https://meta.discourse.org/t/suggested-improvements-to-discourse-backup-format/77451 "2018-01-08T05:41:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 8, 2018, 5:41am UTC](https://meta.discourse.org/t/suggested-improvements-to-discourse-backup-format/77451/1 "2018-01-08T05:41:33Z")

</div>

> [@Migration version is missing from the filename – can't restore from backup](https://meta.discourse.org/t/migration-version-is-missing-from-the-filename-cant-restore-from-backup/77346/10):
>
> The reason we removed the metadata file is because it FORCED a zip compression of the database plus one file.

We are double compressing database:

First time at:

> <https://github.com/discourse/discourse/blob/main/lib/backup_restore/backuper.rb#L188>

Second time at:

> <https://github.com/discourse/discourse/blob/main/lib/backup_restore/backuper.rb#L244>

Instead this really should be a simple “tar file”, with the db added to it and then a bundle of compressed files.

```plaintext
backup.tar

- metadata
- database.compressed
- uploads_folder.compressed

```

This makes it ultra cheap to read `metadata` (since its at the head of the tar file) and means we also stop the double compression of database.
