Suggested improvements to discourse backup format

We are double compressing database:

First time at:

https://github.com/discourse/discourse/blob/master/lib/backup_restore/backuper.rb#L188

Second time at:

https://github.com/discourse/discourse/blob/master/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.

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.

11 Likes