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: 4
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.

Post Reply