# OPERATIONS — Mastermind MVP

## Logs
```bash
cd /root/clawd/mastermind-mvp
docker compose logs -f web
docker compose logs -f db
```

## Restart
```bash
docker compose restart
```

## Update (pull latest code and rebuild)
```bash
docker compose down
docker compose up -d --build
```

## Data persistence
Data is stored under `./data/`:
- `data/postgres/` — Postgres volume
- `data/uploads/` — stored imported `.eml` files

## Backup (manual for now)
```bash
# Stop app for a consistent snapshot
docker compose down

tar -czf mastermind_backup_$(date +%Y%m%d_%H%M%S).tar.gz data .env docker-compose.yml

# Start again
docker compose up -d --build
```

## Restore
```bash
docker compose down
rm -rf data

tar -xzf mastermind_backup_YYYYMMDD_HHMMSS.tar.gz

docker compose up -d --build
```

## Move to a new server (portability)
Copy:
- the whole `mastermind-mvp/` folder (or at minimum: `docker-compose.yml`, `web/`, `worker/`, `data/`, `.env`)

On new host:
```bash
cd mastermind-mvp
docker compose up -d --build
```

Then verify:
- `/health`
- login works
