> ## Documentation Index
> Fetch the complete documentation index at: https://p-bitm-2269ecee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Storage and backups

> Back up and restore P-BitM state while preserving ownership and secrets.

## Persistent data

The host `storage/` directory contains the SQLite database and campaign data,
including screenshots, uploaded files, and browser-profile exports. It is
mounted into the admin backend at `/storage`.

Runtime service and container logs are Docker-managed rather than stored under
`storage/`. Collect them separately when the engagement requires log
retention; a storage backup does not include them.

## Consistent backup

1. Stop or pause active campaigns.
2. Stop the complete runtime with `python3 p-bitm.py down`; this terminally
   completes running, paused, and scheduled campaigns.
3. Copy the complete `storage/` directory to an approved encrypted location.
4. Record the application version and backup checksum.
5. Restart with `python3 p-bitm.py up`.

Copying only `p-bitm.db` can omit artifacts referenced by database rows.

## Restore

Restore the database and campaign directories as one set while the stack is
stopped. Preserve directory accessibility for the host operator and container
UID used by the backend. Run `doctor` before starting.

## Capacity

```bash theme={"system"}
du -sh storage
df -h storage
```

Exports and screenshots can grow independently of the database. Monitor both
free disk space and the engagement retention deadline.

## Deletion

Use dashboard lifecycle controls and approved retention procedures. Do not use
unreviewed recursive shell commands against the repository or storage root.
