# Backup & Restore

*Here is the procedure to backup and restore the Paperless-NGX application and all of its data.*

---

## Backup

On a terminal, enter the following command:

```bash
docker compose exec -T <paperless_webserver> document_exporter -z ../export
```

Where:

- `-T` is used to suppress "The input device is not a TTY" error ;
- `-z` is used to zip the export ;
- `../export` is used because this path inside the container is automatically mounted on your host on the folder export.

## Restore

**You'll need to unzip the previous export!**

On a terminal, enter the following command:

```bash
docker compose exec -T <paperless_webserver> document_importer ../export/<unzipped_directory>/
```

Where:

- `-T` is used to suppres "The device is not a TTY" error ;
- `../export/<unzipped_directory>/` is the path to your previous backup unzipped.