Page 1 of 2

where can i find folders and files stored in OpenKM

PostPosted:Tue Apr 11, 2017 9:25 am
by Florentin
Hi! i would like to know where can i find the folders and files stored and uploaded in OpenKM?
Thanks in advance!

Re: where can i find folders and files stored in OpenKM

PostPosted:Wed Apr 12, 2017 8:40 am
by jllort
OpenKM separate metadata information and binary information. All metadata information is stored into the database like folder name, document name, creation dates etc. Depending what OpenKM datastore is used the binary data location might change ( usually into the file system, but also can be into database ). In case you are using default OpenKM datastore ( what we suggest for best perfomance ) the data is stored under $TOMCAT_HOME/repository/datastore

Should understanding these database tables https://docs.openkm.com/kcenter/view/ok ... odeversion and based in the UUID of the document version you can discover the disk location, for example document version with uuid = '87220c50-1f5b-11e7-9598-0800200c9a66' will be into folder $TOMCAT_HOME/repository/datastore/87/22/0c/50

Finally you can build your own datastorage and distribute documents based in other logic

Re: where can i find folders and files stored in OpenKM

PostPosted:Fri Apr 14, 2017 10:04 am
by Florentin
Thank you for your explanation. I noticed that we could export the data and see it in the correct format through the Administrator part. Is it possible to make the export automatic and periodically?
I would like to make a kind of backup of my archived files.
Do you have another solution that makes the OpenKM Backup?

Thanks in advance!

Re: where can i find folders and files stored in OpenKM

PostPosted:Sat Apr 15, 2017 7:35 am
by jllort
First of all, if you are in production scenario you should use MySQL, Oracle, PostgreSQL, SQL Server etc... ( if you are using default configuration should migrate to one of these ).
You are on Linux or on Windows ?

Re: where can i find folders and files stored in OpenKM

PostPosted:Tue Apr 18, 2017 9:36 am
by Florentin
Hi!
I am using default configuration on Linux. How can i migrate? I would like to know if openkm crontab work by default?

Thanks in advance!

Re: where can i find folders and files stored in OpenKM

PostPosted:Wed Apr 19, 2017 6:30 am
by jllort
Please do not merge several question in the same post. for each question add a new post ( otherwise other readers go into confusion when reading a topic what talks about a lot of things ).

Re: where can i find folders and files stored in OpenKM

PostPosted:Thu Apr 20, 2017 4:09 pm
by Florentin
Hello! alright I understand. I was able to solve the database migration problem. And I was sure how to export my data in human format and I set up a crontab in order to do it regularly. Thank you!

Re: where can i find folders and files stored in OpenKM

PostPosted:Sat Apr 22, 2017 9:41 am
by jllort
At Administration > Tools > You have the OpenKM export tool, take a look here https://docs.openkm.com/kcenter/view/ok ... xport.html

Re: where can i find folders and files stored in OpenKM

PostPosted:Thu Mar 22, 2018 9:08 am
by rosario
@Florentin, could you please share the cronjob you used (its template of course) to periodically export the documents using the tool provided in the Administration section?

Thank you
Rosario

Re: where can i find folders and files stored in OpenKM

PostPosted:Fri Mar 23, 2018 4:20 pm
by silverspr
Hi Rosario
You can find an export script here: https://docs.openkm.com/kcenter/view/ok ... orter.html
You will need to copy and modify it to suit your needs i.e. under configuration parameters: Fspath. Then save the file as a bsh file i.e. myfile.bsh.
Create a new Cron job in OpenKM under Administration and upload your customized bsh file.
hope that helps
d

Re: where can i find folders and files stored in OpenKM

PostPosted:Sat Mar 24, 2018 4:30 am
by rosario
Hi silverspr, thank you for the quick reply.

I noted on the admin dashboard I can check to export both metadata and history, together with the file and the three structure.

Is this also an option I have in the script you pointed me out to or is it something I need to work on?

What happens if I export twice on the same destination folder?

Is the log file of the cronjob appended or rewritten?

Thank you again for your support, have a great week end.
Rosario

Re: where can i find folders and files stored in OpenKM

PostPosted:Sat Mar 24, 2018 2:12 pm
by silverspr
Hello Rosario
Both metadata and history are configurable under the configure parameters section, set each of those items to true.
The destination folder is overwritten each time the export is run.
Sorry I can't answer your question regarding the Cron job log: If I knew where to look for it within OpenKM I could tell you (I'm a client/user like yourself). I did a quick search for a log file and didn't come up with anything.
thanks
d

Re: where can i find folders and files stored in OpenKM

PostPosted:Sun Mar 25, 2018 9:38 am
by jllort
If you export a twice or more times the files will be overwritten, I suspect you want it for some reason. Can you explain what is your scenario?

For log file, there's an export log file at $TOMCAT_HOME/logs named RepositoryExportXXXXX.log

Re: where can i find folders and files stored in OpenKM

PostPosted:Sun Mar 25, 2018 10:35 am
by rosario
Dear silverspr and jllort , thank you for your quick answer.

@jllort, while examining the script mentioned by silverspr to execute as a cron job the export task (see link on his post), I noted the following lines:
// Configuration parameters
String token = DbSessionManager.getInstance().getSystemToken();
String LOG_FILE_NAME = "CrontabRepositoryExporter";
so I thought that such script, once uploaded as a cronjob for openkm, could produce a log report at each execution.

Now, to answer your question and describe the scenario I have in mind, I want to understand if it is possible to create a backup of all documents in a readable format, automatically.

If the export function, either manually or cron-job activated, every time rewrites the entire tree of docs, this may not be a viable option, at least when managing thousands or hundred of thousand documents (not mentioning the fact that right now the repository on my system is on a zfs file system with automated snapshots running hourly, daily, weekly, monthly and yearly).

Ideally if the export was executed onto a previously used directory, it would be great if existing files were just skipped.

As for the log management, is the log mentioned in the above script the same log that you are pointing me out to in $TOMCAT_HOME/logs named RepositoryExportXXXXX.log ?

I would guess no, since the log mentioned in the script should be the log of the cron job, while the log that you are referring to is the log of the export function.

In both cases, is there a rotation policy implemented for all the logs produced?

So, to summarize, the scenario is to understand how to automate a backup function of all the documents stored in openkm, in a readable format (if we include metadata and history, that is great).

I wish that export function could fit the purpose, but it has to be found out if an "incremental" export is possible or not.

Thank you in advance for your support.
Rosario

Re: where can i find folders and files stored in OpenKM

PostPosted:Wed Mar 28, 2018 3:25 pm
by jllort
You can make something more interesting but should build your own script:
1- export all data like now
2- using automation log you can easily identify documents and folders ( created , updated and deleted ) if you follow these actions in order you will be able to update only the contents done into a single day.

You should be interested in
OKM_ACTIVITY table and might be in class LegacyDAO class for queries. From the select ( based in daily range ) you will get uuid of node affected, action etc...