# Backups

Easy Backup backs up the MySQL database and the uploads of your backend on a schedule or on demand and restores individual backups.

> Source: https://www.application-platform.com/en/docs/backups/

Easy Backup is available for projects with a MySQL backend. You enable it in the project configuration, in the same place as phpMyAdmin. It then runs as a sidecar next to your backend: a NestJS API and a Next.js UI in the same Docker network as MySQL. Because the service reaches the database directly over this network, it needs no access to the server's Docker socket. Backups are created with `mysqldump` and `tar` inside the container.

## What a backup contains

A backup has two parts. The database is exported as gzip-compressed SQL. The uploads are stored as a `tar.gz` of the folder `./backend-uploads`, which the deployment mounts into the backend container at `/app/upload`; the convention behind this is described in [Publish the backend]({{< relref "publish-backend" >}}). Archives and metadata live on the server under `./backend-backups`, next to `./backend-mysql` with the database data.

## Three access modes

For each backend you choose exactly one access mode.

In **Internal** mode, the UI is reachable only via `127.0.0.1`, which means locally on the server or through a port forward. Nothing is visible from the internet.

In **Public** mode, the UI gets its own domain or the address `backup.<project>.<org>.ap-clients.com` and is protected with a username and password.

In **Platform** mode, the UI stays internal. The Application Platform talks only to the endpoint under `/api/platform/*` with an API key, and you manage the list, restores, and the schedule in the platform's web interface under **Backups**.

## Schedule and retention

Without your own settings, the backup runs daily at 04:00 in the server's time zone, and the last 14 daily backups are kept. You change both in the Easy Backup UI, through the platform API, or with the `easy-backup` command line, which also triggers and restores backups:

```bash
easy-backup list
easy-backup create --database --uploads
easy-backup restore <id>
easy-backup schedule --cron "0 4 * * *" --retention 14
```

`restore` replays the backup with the given ID, and `create` with both flags backs up the database and the uploads together.

