Giter VIP home page Giter VIP logo

Comments (10)

jonaswinkler avatar jonaswinkler commented on July 17, 2024

Hello.

This breaks due to some change to the way paperless handles filenames (namely the configuration option PAPERLESS_FILENAME_FORMAT). The decryption logic was simply not adjusted to respect these changes and there weren't any test cases in place. You will first have to check if your document archive is still in good shape. It might be not. Please check if:

  • The file is still there (i.e, ../media/documents/originals/0000328.pdf)
  • The file is not encrypted (open it)
  • Go to the admin, check if Storage type of the document in question is set to unencrypted.
  • Check if you can access and download the file and can see the thumbnail.

If any of the above is not true, this either needs to be fixed (which is possible), or you need to recover from a backup.

Paperless-ng still reads encrypted files just fine and the decryption command is verified to work.

Edit. However, there is no warranty. Create a backup before you go this route.

from paperless.

jannislehmann avatar jannislehmann commented on July 17, 2024

Hey, thanks for the fast answer.

I am not yet using paperless-ng, but the main version (paperless).
However, I just tried out paperless-ng and used this command: https://paperless-ng.readthedocs.io/en/latest/administration.html#disabling-encryption
This sadly fails due to some python dependency missing: ModuleNotFoundError: No module named 'termcolor'

Edit:
The files are all still ending with *.pdf.gpg. Thus, the file is still encrypted.

from paperless.

jonaswinkler avatar jonaswinkler commented on July 17, 2024

try copying the file 0000328.pdf.gpg out of the media directory, rename it to .pdf, and see if you can open it, since it might have been decrypted in place.

Regarding the issue: Noted. Now I know where that package was used. I'll have that fixed soon.

from paperless.

jannislehmann avatar jannislehmann commented on July 17, 2024

Alright, great :)

Okay, I did some further testing:
I used a backup, which is entirely encrypted. I created a paperless-ng instance and can download the files. They are missing the file ending. After appending .pdf to any file, I can open and view it. However, the thumbnails are missing.

I will re-try to decrypt the files using original paperless again.
Before I ran the decrypt command, I had 400 files which all ended with .pdf.gpg.
After I ran the decrypt command, I have 399 files which end with .pdf.gpg and one file got renamed to .pdf. This is the file 0000328.pdf. This file is openable and the data is still accessible.

Edit 19:41: I just tried a document export which worked out fine for all files.

from paperless.

jonaswinkler avatar jonaswinkler commented on July 17, 2024

Okay, hold on. You're actually the first one going this route and I totally forgot to take care of something during the migration process regarding encrypted files.

Uhm, I'd like to address this and will keep you posted.

Importing an export from paperless into the current version of paperless-ng won't work.

from paperless.

jannislehmann avatar jannislehmann commented on July 17, 2024

Nah, this is not what I am trying to achieve.

I want to shutdown my old instance and decrypt the old files before.
Afterwards, I want to start paperless-ng.

I don't want to use an export since this would mean that I will loose all the tags etc.

from paperless.

jonaswinkler avatar jonaswinkler commented on July 17, 2024

I think the best way would be to fix up the decryption code in this repository, but I don't know how active the people responsible for merging changes are.

from paperless.

jannislehmann avatar jannislehmann commented on July 17, 2024

Sorry, for asking again:

Do you know that options I would have with paperless-ng?
You do offer a command to decrypt, which seems to be broken because you tried to clean up dependencies.
If this would be fixed, I could decrypt the files using paperless-ng? Therefore, I should be able to use paperless-ng already and wait for this fix?

The issue in this repo seems to be:
https://github.com/the-paperless-project/paperless/blob/master/src/documents/management/commands/change_storage_type.py#L95

from paperless.

jonaswinkler avatar jonaswinkler commented on July 17, 2024

Alright, summary of the issue:

  • Please don't migrate to paperless just yet. The operations that make the existing data compatible with -ng do not account for encrypted files, and leave some important data uninitialized. This also causes the file extensions to disappear.
  • I'll have both the issue with the conversion operations and the issue with the decryption command addressed.
  • I'd like to test that.
  • Before that, I don't see any options for moving away from paperless.
  • After that, you'll be able to move to paperless-ng with your existing encrypted database, and optionally use the decryption command.

This might take a bit of time.

from paperless.

jannislehmann avatar jannislehmann commented on July 17, 2024

Alright, thank you a lot for your effort, work and fast answers!

I removed the two lines in question: https://github.com/the-paperless-project/paperless/blob/master/src/documents/management/commands/change_storage_type.py#L95
Afterwards, all files decrypted fine. Now I am able to start paperless-ng and view all files.
Lastly, I will have to migrate sqlite to postgres.

from paperless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.