# Clearing and exporting

Source: https://modulify.ai/docs/data/clearing-and-exporting

Get your data out, or wipe it, from the CMS and Storage panels.

Both your database and your storage can be downloaded in full, and both can be emptied. Exporting needs a Pro plan. Clearing does not, but it is permanent.

## Before you begin

Export actions are disabled on Free and Starter. There, the **Export database** and **Export storage** rows and a collection's **Export as CSV** menu item carry a **Pro** badge, and the **Export .zip** buttons and an item's **Export as CSV** say why in a tooltip. On a Pro plan the badges are not shown.

Clearing needs the **Delete projects** permission in the workspace. The **Clear collections** and **Clear storage** buttons are disabled with "You do not have permission to do this." when you lack it, and clearing a single collection is refused by the server for the same reason. When your [role on the site](https://modulify.ai/docs/editor/settings#member-access) is Content editor, **Clear collections** is disabled with "Your role on this site does not include this." instead.

## Export the whole database

Open the **CMS** tab, switch to the **Settings** sub-tab, and find the **Export** section. Pick a format from the dropdown, then press **Export .zip**.

| Format | What you get |
|---|---|
| CSV | One `.csv` file per collection inside the zip |
| JSON | One `.json` file per collection inside the zip |
| SQL | A single `.sql` file with `CREATE TABLE IF NOT EXISTS` and `INSERT` statements for every collection |

The file downloads as `<your-slug>-database.zip`. Hidden system collections are left out.

A whole database export is capped at 100,000 rows. Above that it fails with "Your database is too large to export in one file. Export collections individually instead!"

## Export one collection

Select the collection, open the three dots menu next to **Add**, and choose **Export as CSV**. That downloads just that collection, named after the project and the collection. The file stops at 100,000 rows, without an error.

The menu item is disabled while the collection is empty.

## Export one item

Hover a row and open the three dots menu at its right end, or open the row and use the three dots menu in the editor header, then choose **Export as CSV**. That downloads a single row.

## Clear one collection's data

From the same three dots menu next to **Add**, choose **Clear data**. The confirmation is titled "Clear collection data?" and explains that it permanently deletes every item in the collection, while the collection, its fields and its structure stay intact, and that items in other collections linked to these may also be removed. The images and files those items uploaded are deleted from the `CMS` folder of [Storage](https://modulify.ai/docs/data/storage#the-cms-folder) as well.

**Clear data** needs the **Delete projects** permission and the Editor role on the site. Without the permission it is greyed out with "You do not have permission to do this.", and for a Content editor or Viewer with "Your role on this site does not include this."

If links from rows in other collections stop the clear, it is refused with "Some items are linked from other collections and cannot be cleared. Clear those collections first!" Work down the chain and clear the dependents first.

System collections and the field metadata table cannot be cleared this way.

## Clear every collection

In the CMS **Settings** sub-tab, under **Danger zone**, press **Clear collections**. The confirmation is titled "Clear all collections?" and warns that it permanently deletes every collection and all of its data, and that anything on your site using them stops working until they are recreated.

Chat can empty one collection or clear every collection for you when you ask, after you confirm, with the same **Delete projects** permission as these buttons. On a site with [several chats](https://modulify.ai/docs/build/multiple-chats), it does so only while no other chat is running.

This is stronger than clearing one collection. It drops the tables themselves, structure included, not just the rows, and deletes the whole `CMS` folder of [Storage](https://modulify.ai/docs/data/storage#the-cms-folder), where the CMS kept their images and files. Your database stays provisioned and `DATABASE_URL` and `DATABASE_TOKEN` keep working, but the database comes back empty and the AI has to rebuild the schema.

The button is disabled when the database has no collections.

The same **Danger zone** holds **Delete all database backups**, whose **Delete backups** button removes every finished backup of the site after asking **Delete every database backup?** It leaves your collections and their data exactly as they are, and needs the same permission. See [Delete a database backup](https://modulify.ai/docs/editor/backups#delete-a-database-backup).

## Database backups are not exports

A paid plan also takes a daily backup of the whole database, listed under the **Database** tab of [Backups](https://modulify.ai/docs/editor/backups). It is a separate copy, not the export above, and it works differently:

- it is taken once a day on its own, unless you turn **Daily backups** off in the **Backups** section of the same sub-tab, and **Backup** takes one by hand, while an export happens only when you press **Export .zip**
- it holds every table, the hidden ones included, with their indexes, triggers and views, as a single `database.sql` rather than one file per collection in a format you pick
- it is not capped at 100,000 rows, only by the size of the database
- it cannot be restored, only downloaded and deleted

Clearing one collection or every collection keeps every backup already taken, so a backup from before the clear still holds the rows. After a full clear the database has no tables left, so the daily backup passes it over until the AI rebuilds the schema.

## Export storage

Open the **Storage** tab, switch to the **Configuration** sub-tab, and press **Export .zip** in the **Export** section. Every file and folder comes down as `<your-slug>-storage.zip`.

The zip is capped at 100 MB in total. Above that: "Your storage is too large to export as a single zip. Download files individually instead!" There is also a scan ceiling of 20,000 objects, which reports "Your storage has too many files to export as a single zip. Download files individually instead!"

For anything larger, download from the file browser instead, either a single file's **Download file** action or a multi select **Download**.

## Clear storage

In the **Configuration** sub-tab, under **Danger zone**, press **Clear storage**. The confirmation is titled "Clear all storage?" and explains that it permanently deletes every file and folder, along with every folder privacy setting, and that "The CMS folder is kept, because the CMS manages it." The [CMS folder](https://modulify.ai/docs/data/storage#the-cms-folder) holds the images and files of your CMS items, which go when their items do.

Your CDN link and your storage key survive, so site code can still read and write storage. It just has nothing to read until something writes again. Folder visibility settings do not survive the clear: a file your site writes afterwards follows the top level default until you make those folders private again or the site passes `visibility` on each write. See [Which files are private](https://modulify.ai/docs/data/storage#which-files-are-private).

Chat can clear storage too when you ask, after you confirm, with the same **Delete projects** permission. On a site with [several chats](https://modulify.ai/docs/build/multiple-chats), it does so only while no other chat is running.

Clearing storage keeps every [storage backup](https://modulify.ai/docs/editor/backups#storage-backups) already taken, so an archive from before the clear still holds the files, and on a paid plan **Restore backup** on it puts them back. To remove the archives too, use **Delete backups** on the **Delete all storage backups** row in the same **Danger zone**, which asks **Delete every storage backup?** and needs the **Delete projects** permission. While a storage backup is being restored, **Clear storage** is disabled with "Wait for the restore that is running to finish."

## From an AI client over MCP

The clearing actions on this page all have tools: `clear_collection` for one collection, `clear_site_database` for every collection, `clear_storage` for the whole storage bucket, `clear_site_analytics` for the visitor history, and `clear_storage_backups` and `clear_database_backups` for every backup of one kind. Each is irreversible. `clear_storage` needs the `data:write` scope and the rest need `sites:delete`, and both scopes are unticked by default.

The downloads do not. `Export .zip`, the code export and the CSV exports all hand the browser a file, and a connected client receives structured data rather than files. A client gets the same content another way: `export_collection` reads every row of one collection, or one row, in a single call on a Pro plan, `list_rows` reads a collection page by page, `read_storage_file` reads a stored file, `read_storage_backup_file` reads a text file out of a storage backup, and `get_storage_file_url` returns a download link for one file at a time. The whole database comes out only as the **Export .zip** archive.

See [MCP tools](https://modulify.ai/docs/mcp/tools#database).

## Next

- [The CMS](https://modulify.ai/docs/data/cms) covers the panel these actions live in.
- [Storage](https://modulify.ai/docs/data/storage) covers per file deletes and downloads.