# XtraBackup and deleted files

**URL:** <https://forums.percona.com/t/xtrabackup-and-deleted-files/2298>\
**Category:** Percona XtraBackup\
**Created:** [September 25, 2012, 8:24am UTC](https://forums.percona.com/t/xtrabackup-and-deleted-files/2298 "2012-09-25T08:24:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kayjay](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kayjay](https://forums.percona.com/u/kayjay)\
**Post date:** [September 25, 2012, 8:24am UTC](https://forums.percona.com/t/xtrabackup-and-deleted-files/2298/1 "2012-09-25T08:24:04Z")

</div>

This may sound a strange question but does a backup/restore cycle remove deleted records from a innodb database in the same way as in mysqldump?

Many thanks

---

<div class="post-metadata">

**Author:** ![martin.arrieta](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/martin.arrieta/32/16888_2.png) [@martin.arrieta](https://forums.percona.com/u/martin.arrieta)\
**Post date:** [October 11, 2012, 9:31am UTC](https://forums.percona.com/t/xtrabackup-and-deleted-files/2298/2 "2012-10-11T09:31:30Z")

</div>

No, xtrabackup will not remove those deleted rows from the ibd or ibdata\* files because xtrabackup will copy and use those files instead re-create them.

To do that, you have to use mysqldump or if you have “innodb\_file\_per\_table” enabled, you can use an alter table to re-create the table. “ALTER TABLE tablename ENGINE = InnoDB;”

To avid locking in the alter table, you can use “pt-online-schema-change”

Martin Arrieta.
