# Paperless-ngx

**Paperless-ngx** is a document management system that transforms your physical documents into a searchable online archive.

# 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.

# Consumption fails with "Ghostscript PDF/A rendering failed"

When updating Paperless-NGX, you may get the following error:

<p class="callout danger">Consumption fails with "Ghostscript PDF/A rendering failed"
Newer versions of OCRmyPDF will fail if it encounters errors during processing. This is intentional as the output archive file may differ in unexpected or undesired ways from the original. As the logs indicate, if you encounter this error you can set PAPERLESS_OCR_USER_ARGS: '{"continue_on_soft_render_error": true}' to try to 'force' processing documents with this issue.</p>

To fix this, you can:

1. Go to your paperless web interface
2. Go to **Configuration** menu
3. Go to **OCR Settings** tab
4. In the **OCR Arguments** tile, enter `{"continue_on_soft_render_error": true}`
5. Save

And, the error is fixed!

# Creating a Super User

If you don't have a super user with your Paperless-NGX installation, you can create one with a command.

```bash
docker compose exec -it <PAPERLESS CONTAINER> createsuperuser

> Username (leave blank to use 'paperless'): 
> Email address: 
> Password: 
> Password (again):
> Superuser created successfully.
```