PAPERLESS_FILENAME_FORMAT does not modify the files structure into folders

ngx (with Docker) on a Raspberry Pi5 with Trixies with success.

After, I uploaded a document, I can see a list of files in this location /paperless-ngx/media/documents/originals

-rw-r--r-- 1 pierrot 166300 14 jan 19:59 0000001.pdf
-rw-r--r-- 1 pierrot 453908 14 jan 20:09 0000002.pdf
-rw-r--r-- 1 pierrot 171460 14 jan 20:25 0000003.pdf
-rw-r--r-- 1 pierrot 632003 14 jan 21:33 0000004.pdf
-rw-r--r-- 1 pierrot 218267 14 jan 22:02 0000005.pdf
-rw-r--r-- 1 pierrot 354021 14 jan 22:12 0000006.pdf
-rw-r--r-- 1 pierrot 248148 14 jan 22:20 0000007.pdf
-rw-r--r-- 1 pierrot 244836 14 jan 23:11 0000008.pdf
-rw-r--r-- 1 pierrot 768796 14 jan 23:19 0000009.pdf

I discovered, I can format a structure with the setting PAPERLESS_FILENAME_FORMAT.

This PAPERLESS_FILENAME_FORMAT={{created_year}}/{{correspondent}}/{{document_type}}/{{title}} should result with folders structure as: /2025/company/bill/filename.pdf

How I process

Installation of Docker (quick steps)

sudo apt install apt-transport-https ca-certificates curl gpg

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian trixie stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

apt-cache policy | grep docker

sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo systemctl is-active docker

sudo useradd user docker

docker ps

Installation of Paperless

bash -c "$(curl --location --silent --show-error https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/install-paperless-ngx.sh)"

I mostly keep the default value excepted for the URL and the meida, data, db and consum folders where are located to the paperless root folder.

I uploaded some files then I tried to change the configuration with the goal to have a structure of my saved documents as I mentionned before

What I did and tried

I edited the file nano `paperless-ngx/docker-compose.env` and I added the setting PAPERLESS_FILENAME_FORMAT

PAPERLESS_URL=http://s.server.ch
PAPERLESS_TIME_ZONE=Europe/Zurich
PAPERLESS_OCR_LANGUAGE=fra
PAPERLESS_SECRET_KEY='pEIWILLqchangedme3bX*k!siCHANGEMEK+ZBl|'
PAPERLESS_FILENAME_FORMAT={{created_year}}/{{correspondent}}/{{document_type}}/{{title}}

I saved and closed and I return to my uploaded document and I resaved it. I restarted my Raspberry

Error

I do not have any error, excepted that the listing files are the same

-rw-r--r-- 1 pierrot 166300 14 jan 19:59 0000001.pdf
-rw-r--r-- 1 pierrot 453908 14 jan 20:09 0000002.pdf
-rw-r--r-- 1 pierrot 171460 14 jan 20:25 0000003.pdf
-rw-r--r-- 1 pierrot 632003 14 jan 21:33 0000004.pdf
-rw-r--r-- 1 pierrot 218267 14 jan 22:02 0000005.pdf
-rw-r--r-- 1 pierrot 354021 14 jan 22:12 0000006.pdf
-rw-r--r-- 1 pierrot 248148 14 jan 22:20 0000007.pdf
-rw-r--r-- 1 pierrot 244836 14 jan 23:11 0000008.pdf
-rw-r--r-- 1 pierrot 768796 14 jan 23:19 0000009.pdf

My investigation

I found the following information

However, when changing PAPERLESS_FILENAME_FORMAT you will need to manually run the document renamer

As I have a few experience, I searched how to us Management utilities https://docs.paperless-ngx.com/administration/#management-commands

and then I was not sure how to use it.

docker ps list me the following

88691b0f1fdd   ghcr.io/paperless-ngx/paperless-ngx:latest    paperless-webserver-1
7baf29d6bb65   redis:8                                                                paperless-broker-1
f9e74337bba7   postgres:18

I remembered paperless-webserver-1, paperless-broker-1 and paperless-db-1 under the column 'name'

then I run docker exec -it paperless-webserver-1 document_renamer

Then I thing good to run docker exec -it paperless-webserver-1 document_renamer

but sadly, nothing changed. The files are all listed in the same level, as shown before (no folder structure according to the setting.

I wonder, if someone has an experience with this topics and how can I adapted my setting according to that need.

Thanks

Вернуться на верх