Export all Documents

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
Crayiii
Posts: 9
Joined: Fri Aug 24, 2018 12:25 am

Export all Documents

Post by Crayiii » Wed Nov 07, 2018 4:06 pm

I'm looking to try to get Mayan-EDMS installed as a docker on my unRAID server. I currently have it running in a VM but there are weird issues that have cropped up with ACL's, etc.

Is there a way to export all of the documents in a batch from the database to a folder and have the original file names? Then I can import that folder and start from scratch.

User avatar
rosarior
Posts: 159
Joined: Tue Aug 21, 2018 3:28 am

Re: Export all Documents

Post by rosarior » Fri Nov 09, 2018 4:02 pm

No official method yet to export documents. I've seen some scripts to dump them using the API of a Python shell.

Maybe we can add a simple document only exporter. The only issue is filename collisions.

theintelligentmouse
Posts: 5
Joined: Thu Nov 01, 2018 7:16 am

Re: Export all Documents

Post by theintelligentmouse » Sun Nov 11, 2018 10:00 pm

Yes I was also going to suggest using the API to iterate through the documents and download them.

It would follow something like...

GET /api/documents/

<LOOP THROUGH RESULTS>

GET /api/documents/{id}/

<USE META INFO FOR FILENAME>

GET /documents/{id}/download/

<IF NOT EXISTS>
<SAVE FILE USING NAME FROM META>

<ELSE>
<SAVE FILE USING NAME FROM META + RANDOM>


Would be fairly straight-forward to write in PHP or Python, I'd use PHP and cURL to simply go through the above steps.

bernd
Posts: 4
Joined: Tue Aug 28, 2018 9:08 pm

Re: Export all Documents

Post by bernd » Mon Nov 26, 2018 4:14 pm

has one of you guys finished such script?

bernd

KevinPawsey
Posts: 50
Joined: Wed Aug 22, 2018 2:52 pm

Re: Export all Documents

Post by KevinPawsey » Tue Nov 27, 2018 12:16 am

Silly question, but can’t you just go to Documents/All Documents.

Once that page has loaded, on the top right there is a drop down with a tick box next to it. Tick the box, that selects all documents, then go to “Advanced download” in the drop down. From there you can download all documents in a zip file.

Maybe that will work? I haven’t tried it myself, just noticed the option the other day.

Hope it helps

Kevin

Post Reply