I try to fix it now, again…
First error was:
Warning: File or folder '/var/www/paperless-ngx' to be backed up does not exist
Error: Failed to collect files to backed up for paperless-ngx.
So i just mkdir it and tried again…
Then it ends with:
Warning: /var/cache/yunohost/app_tmp_work_dirs/app_0qm7yfeh/scripts/backup: line 19: data_dir: unbound variable
Error: Failed to collect files to backed up for paperless-ngx.
Seems i have a good last backup without any loss data:
root@YunoHost:~# find /home/yunohost.app/paperless-ngx/ -type f -printf '%TY-%Tm-%Td %TH:%TM %p\n' | sort -nr | head -n 5
2025-12-22 16:04 /home/yunohost.app/paperless-ngx/data/log/paperless.log
2025-12-22 16:04 /home/yunohost.app/paperless-ngx/data/log/celery.log
2025-12-22 16:04 /home/yunohost.app/paperless-ngx/data/celerybeat-schedule.db.db
2025-12-22 16:00 /home/yunohost.app/paperless-ngx/data/log/mail.log
2025-12-22 15:57 /home/yunohost.app/paperless-ngx/media/media.lock
root@YunoHost:~# find /home/yunohost.backup/archives/ -type f -printf '%TY-%Tm-%Td %TH:%TM %p\n' | grep paperless | sort -nr | head -n 5
2025-12-22 16:04 /home/yunohost.backup/archives/paperless-ngx-pre-upgrade1.tar.gz
2025-12-22 16:04 /home/yunohost.backup/archives/paperless-ngx-pre-upgrade1.info.json
So last changed file is from 2025-12-22 16:04 as the last backup of v2.17.1~ynh1.
So i try to deinstall the app and restore 2.17.1~ynh1 from the backup. Hope that fixed the issues.
EDIT: This works: Now i have a running 2.17.1~ynh1 back … No i will create a normal backup and try to upgrade…
EDIT2: upgraded from version 2.17.1~ynh1 to 2.20.3~ynh1 doesn’t work, because PostgreSQL 14 is needed, see:
...
Warning: File "/var/www/paperless-ngx/venv/lib/python3.11/site-packages/django/db/backends/postgresql/base.py", line 398, in init_connection_state
Warning: super().init_connection_state()
Warning: File "/var/www/paperless-ngx/venv/lib/python3.11/site-packages/django/db/backends/base/base.py", line 225, in init_connection_state
Warning: self.check_database_version_supported()
Warning: File "/var/www/paperless-ngx/venv/lib/python3.11/site-packages/django/db/backends/base/base.py", line 201, in check_database_version_supported
Warning: raise NotSupportedError(
Warning: django.db.utils.NotSupportedError: PostgreSQL 14 or later is required (found 13.20).
Error: Failed to upgrade paperless-ngx: An error occurred inside the app upgrade script
So i assume 2.20.3~ynh1 doesn’t work with
EDIT3: Hm! In YunoHost v12.1 with bookworm Postgres v15 and v16 should be available… And it’s installed:
root@YunoHost:~# apt list --installed 'postgresql-*'
Listing... Done
postgresql-13/now 13.20-0+deb11u1 amd64 [installed,local]
postgresql-15/oldstable,now 15.14-0+deb12u1 amd64 [installed]
postgresql-16-pgvector/now 0.8.1-2.pgdg12+1 amd64 [installed,local]
postgresql-16/now 16.11-1.pgdg12+1 amd64 [installed,local]
postgresql-client-13/now 13.20-0+deb11u1 amd64 [installed,local]
postgresql-client-15/oldstable,now 15.14-0+deb12u1 amd64 [installed,automatic]
postgresql-client-16/now 16.11-1.pgdg12+1 amd64 [installed,local]
postgresql-client-common/now 264.pgdg110+1 all [installed,local]
postgresql-common/now 264.pgdg110+1 all [installed,local]
postgresql-contrib/oldstable,now 15+248+deb12u1 all [installed,automatic]
root@YunoHost:~# pg_config --version
PostgreSQL 16.11 (Debian 16.11-1.pgdg12+1)
root@YunoHost:~# psql --version
psql (PostgreSQL) 16.11 (Debian 16.11-1.pgdg12+1)
So what’s the problem here?!?