# Xtrabackup built-in compression after --prepare

**URL:** <https://forums.percona.com/t/xtrabackup-built-in-compression-after-prepare/7571>\
**Category:** Percona XtraBackup\
**Created:** [April 22, 2020, 11:56pm UTC](https://forums.percona.com/t/xtrabackup-built-in-compression-after-prepare/7571 "2020-04-22T23:56:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzzaresk](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jzzaresk](https://forums.percona.com/u/jzzaresk)\
**Post date:** [April 22, 2020, 11:56pm UTC](https://forums.percona.com/t/xtrabackup-built-in-compression-after-prepare/7571/1 "2020-04-22T23:56:10Z")

</div>

So with xtrabackup you can:  
_xtrabackup --backup --compress --compress-threads=N --target-dir=/path/to/backup_   
why not:  
_xtrabackup --prepare --compress --compress-threads=N --target-dir=…_  
I haven’t found an easy way to use xtrabackup’s built-in compression after preparing a backup, if I missed something let me know. What I’m looking for is an easy way to have the host that’s providing the backup also prepare and then compress the full backup into an xbstream archive. Then when we go to restore, its just downloading the archive, _xbstream --extract …_ and _xtrabackup --decompress_, and _xtrabackup --copy-back …_

---

<div class="post-metadata">

**Author:** ![jrivera](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jrivera/32/13_2.png) [@jrivera](https://forums.percona.com/u/jrivera)\
**Post date:** [May 7, 2020, 1:40am UTC](https://forums.percona.com/t/xtrabackup-built-in-compression-after-prepare/7571/2 "2020-05-07T01:40:11Z")

</div>

I would suggest opening a Jira ticket under the PXB project ([jira.percona.com](http://jira.percona.com)) since this may or may not be considered as a feature request by the dev team. However, a workaround would be to prepare the backup and store everything in a tar.gz file.

---

<div class="post-metadata">

**Author:** ![jzzaresk](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jzzaresk](https://forums.percona.com/u/jzzaresk)\
**Post date:** [May 8, 2020, 10:02am UTC](https://forums.percona.com/t/xtrabackup-built-in-compression-after-prepare/7571/3 "2020-05-08T10:02:10Z")

</div>

That’s fair, basically a feature request.&nbsp; I created the issue,&nbsp;[https://jira.percona.com/browse/PXB-2174](https://jira.percona.com/browse/PXB-2174 "Link: https://jira.percona.com/browse/PXB-2174")
