# Backing up and packing Plone's database file (Data.fs)

## Backing up the database

See “[Backup Plone](http://plone.org/documentation/how-to/backup-plone)” and “[Backup and recover Data.fs in linux](http://plone.org/documentation/how-to/backup-and-recover-data-fs-in-linux)” in Plone’s documentation.

Additional notes:

- Recent versions of Repozo can compress (gzip) the backup files in addition to doing incremental backups.
- When doing full backups, Repozo behaves exactly as using cp to copy Data.fs, except it uses ZODB’s code to determine where the last finished transaction is and therefore do not copy unfinished transactions at the end of Data.fs.
- Zope’s <span class="caps">ZODB</span> can use multiple “storages” (think of it as something like database backends). It comes with FileStorage (i.e. storing everything in Data.fs). [DirectoryStorage](http://dirstorage.sourceforge.net/) is an alternative that is supposingly easier and faster to back up incrementally.

## Packing the database

Packing a database throws away old object versions (generated by undo actions) from the database. To pack a database:

Go to Zope’s admin panel, under Control Panel → Database → \[database name, e.g. main\], choose how much undo info to keep, and click “pack”. Note: <tt>Data.fs.old</tt> will contain a copy of the database file before packing.

(There is a Zope product called [PloneMaintenance](http://ingeniweb.sourceforge.net/Products/PloneMaintenance/) that can do scheduled backup, although I have not tried it yet.)