> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ardoiseeduc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Backups, verification and restore

> Verified school backups, attached files and PostgreSQL recovery into an isolated target.

<Note>This concerns the OHADA School installation, not an Austrian school or Marketplace institute backup.</Note>

## Enable and monitor backups

The founder authorises the selected Drive from their dashboard and enables backup. The provided deployment's `backup_worker` runs periodically; success requires valid connectivity, permissions and configuration. Check the last result and date, not just the presence of a Google connection.

To run the job manually on the installation:

```bash theme={null}
docker compose exec app python manage.py run_cloud_backup
```

## Contents and verification

The ZIP includes the database dump, covered media/attachments and `ardoise_manifest.json` with integrity checks. Depending on the installation, additional storage artefacts are included when produced; check the manifest and warnings. An archive cannot prove that files missing from its source were backed up.

After placing your archive in the container, verify without restoring the active database:

```bash theme={null}
docker compose exec app python manage.py verify_backup /app/data/backup.zip
```

Replace the example path with your archive. Verification checks the manifest, members, checksums and dump; alone it does not prove complete PostgreSQL recoverability. Copying only `data/` excludes the PostgreSQL database in its separate volume.

## Restore a PostgreSQL installation

1. Download the selected archive, verify integrity and prepare an isolated installation without connected users or new records.
2. The administrator restores the manifest's dump with **`pg_restore`** into the target PostgreSQL database. A dump may have a `.sql` extension but uses PostgreSQL's custom format; do not load it as text SQL with `psql`.
3. Restore media and any additional artefacts into their matching volumes. Separately verify local configuration and secrets on the new installation; the database dump does not automatically recreate them.
4. Restart and verify health, school identity, records, attachments and reports in that target. Switch the operational installation only after responsible staff review it.

<Warning>
  `restore_backup --check` restores only SQLite test/compatibility archives into a temporary target. It is not a production PostgreSQL restore. Regularly test a real isolated PostgreSQL recovery. School activity can continue without new backups when Drive access is revoked or a job fails: correct the error and check the next result.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.